I think there is an error in code for script command wait_click(0).
This code works:
This code works not:
The second script should be wait for any key click, but wait_click(0) is ignored. The same with uBasic. I've tested with the recent version of CHDK (rev. 1165) and CHDK-DE (rev. 652).
It is very important to solve this problem. Many scripts in our script collection (German CHDK forum) use this command.