There is a uBASIC tutorial here:
http://chdk.wikia.com/wiki/UBASIC/TutorialScratchpad... but it's already outdated by changes to CHDK and its interpreter. That doesn't mean it's hopeless, though. The popular scripts on the CHDK wiki are generally short. Print out a few and try to follow one along, line-by-line, with the tutorial beside you, and it will start to make sense. There's also a PDF version of the tutorial; you'll find a link to it in the introduction on the web page. Read the whole thing through, then read those scripts you printed. Chances are, you'll not only understand what you read, you'll get ideas for changes you want to make to improve or customize them.
Here are a few important ways the documentation is outdated:
It says the parameters can only have the names a though j. Now you can use the whole lowercase alphabet. In addition, you can use the uppercase alphabet for variables within a script, though you can't bring them out to the menus to be changed before the script is run. They're strictly internal.
The docs say that the get_xxxx commands are used like this: get_focus f where f is a variable I made up to hold the value of the focus distance in mm. set_focus and the other set_xxxx commands work that way, but the get_xxxx commands are turned around: f = get_focus will store the focus distance in f. You can also use the get_xxxx functions as variables in an equation: f = get_focus + 10
Some of the commands are obsolete. My first script crashed over get_tv, which is supposed to get me the current time-value (shutter speed) in the camera. It's been replaced with get_tv96, which does the same, except that it divides each doubling or halving of the shutter speed into 96 tiny steps. (I read an article last week about HDR, and the author groused that Nikons can't do shutter speeds in 1/3-steps like Canons, and Canons can't do half-steps like Nikons. I couldn't help grinning, thinking of 1/96-steps available to CHDK users.)
Just this month, parameters got a new parameter of their own: @range. It allows you to limit the number values that the user can input for any variable.
The docs are so far behind because CHDK is a labor of love by people who love to hack. Every now and then, somebody stands back and tries to assemble all the information about CHDK or scripting into an organized, useable reference, and by the time he or she is done, the hackers have jumped ahead again. So it takes some reading and researching to catch up, but that doesn't make it any less satisfying when your script makes your camera do stuff that no other camera in the world does. Enjoy.