Have you tried any of the scripts located here in the wiki?
http://chdk.wikia.com/wiki/UBASIC/ScriptsThe reason I ask is that maybe there's not enough time to write the RAW file between shots and the camera is shutting down? When you said the intervalometer script works, that's maybe because it sets the time between the shots?
I use one of the scripts for the A640 (under other) in the scripts, which allows one to set the time in between shots. Perhaps one of the others under bracketing may work for you.
Just a thought, I could be way wrong, but give them a try. Who knows, one might just work. That page is extremely difficult to find, so you might not have been through the bracketing scripts (there are plenty).