It's just a hobby - I'm not a pro like you guys.
Canon is not that "cheap", all cameras have hardware limitations which require software limitations. I've already pushed my SD4000 over the limits. There is no "DNG issue", it's a general memory/CPU issue which affects all kinds of shots at slower shutter speeds as the camera needs more power to process images. Fixing this would require rewriting both Canon's original memory management and CHDK, as well as replacing RAM/CPU chips with better ones. It would be an entirely different camera.
SD4000 is a special beast, not a "black sheep" but a "white crow". Cramming real aperture and low noise performance into such tiny well-shaped body obviously required several compromises, which include AF system operation etc. Partitioned cards are not recognized by this cam. Still, the machine is the king of all IXUS cameras. Jog wheel successfully replaces the control ring, which affects pocketability in great extent. Bravo!!!
I did try to run your MF test script, and it's all fail fail fail followed by freeze at third or fourth step. Tried it a couple of times, followed the instructions carefully. I'm not even going to post CSV, it's not worth it. I expected this. Fortunately, there is no damage to the camera. Basically, when you go over the limits,
fixing some things breaks other things, and this is exactly what I experienced with the test build. After all, the primary purpose of cameras is shooting pictures, not constant (re)programming.
But I didn't came back for this, I just wanted to post more useful shooting tips for SD4000 users:
If you want maximum sharpness and contrast, shoot around 50mm equiv. wide-open (f4). Lens is ridiculously sharp at 50 f4, contrasty, and it's comparable to my DSLR, particularly if I use masking while sharpening in LR. My copy is a bit softer on the left side, but only at 100%. Could be DoF issue as well. You can print huge from these RAWs, and you can crop a bit as well. Pay attention to ND filter warning, as ND blurs the image. Stop down to f7.1 if there's too much light. You can also hold a high quality ND filter in front of the lens, with built-in ND blocked by CHDK. f7.1 is the overall best aperture for daytime situations. With max auto ISO 800 and f7.1 you don't need to worry about settings, you just go around and shoot being entirely focused on your composition.
Don't forget the REFRESH RAM METHOD as I called it, while shooting at 1/15 or slower. Just push playback button, quickly or slowly, wait for complete image data to load including image size in the lower right corner, and then return to recording mode. There will be no hangs. For 1/15-1/8 do it occasionally, for 1/8-1/4 do it more often, for 1/4 and slower do it after every shot. Removing the battery and turning on the camera in rec mode is also pretty fast with autostart script and sleep 500 at the beginning of the script.
Use NORMAL size focus point in low low light outdoors (indoors as well). Turn on AF point zoom. This helps a lot. Important: FOCUS HUNTING also contributes to camera freezing after taking shot! If you experience focus hunting, employ the REFRESH RAM METHOD just to be safe the camera won't hang. These solutions are fast enough for static subjects. I don't do street photography, if I did, I would probably get Ricoh GR with prefocus ability. In the end, I had focus hunting issues only with some scenes in the park poorly lit by distant lamps, but why would you shoot that anyway!? My DSLR also has focusing issues in such scenes. Also, feel free to set max auto ISO to 1600 and use f4, because 28mm f4 can be sufficiently sharp in the center even at 100%, even during night. f2 is soft but works for smaller spaces and closer objects.
Always take a spare battery!
Well, I guess that's it... No need to come back in a couple of months

I am thankful to Canon for making this machine, and CHDK programmers for making my SD4000 more useful.