I've uploaded a new build, details here
http://chdk.setepontos.com/index.php?topic=6231.msg89893#msg89893The "shoot" command may or may not be useful for you, but the underlying functions are available as
exp.shutter_to_tv96 and exp.iso_to_tv96
A few notes on the code you posted above:
shoot() can hang indefinitely if the camera isn't in a still shooting mode (playback or video)
If you ever up inputting a Tv value that doesn't convert exactly to one of the valid values, you will take a picture with whatever the current setting are, without any warning to the user.
Under the current CHDK stable builds, if your tv is exactly 1 second, it will be ignored. I have put a fix for this bug in the unstable development branch. Once I'm convinced it doesn't break anything, I will back port it to the stable branch.