What happens when you zoom in + out once before starting the script? Some of the ixus (aka SD*) cams behave like that when you try to set the SD (subject distance - manual focus..) override, but triggering the zoom once helps..
Btw, i dont think a specific zoom override function would work better than that script, they both need to access the same function in the camera firmware to set the zoom - when that function crashes the camera while taking an exposure, theres not much you can do (i guess. no guarantee i'm right.)