If you can figure out where sleeps are definitely required, and post simple test cases for them, we can enforce some of this in CHDK itself. Or at least document them on the wiki.
Not an automated test case, delay after click required otherwise the click gets ignored / unreliable. For daylapse, this was in selecting MF focus mode on first shot, and after cam idle. At one stage it was ignored first 'down' to go change focus mode and misused the following 'up' to go flash mode select. Bizarre, until I worked out what was happening
I wouldn't expect prints to be a problem.
Display corruption where the console text would disappear if delay not used, may be associated with changed or changing Focus Mode -- I had trouble in that area, and, after adding 300ms after each print, no more problems. Mostly cosmetic, I seem to recall, didn't stop script from working but made the screen write look better.
Like always it seems, my focus was elsewhere, so undocumented, but I didn't need debug text disappearing on me at the time! Part of not documenting all changes was due to hitting the script size limit[1] and comment stripping to get the thing working again. Ignoring comments on script load would be good, though it could break some scripts' timing?
[1]Another factor is the SDHC memory seems to go stupid after a while of rewriting the same file, so I'd format and reload SDHC -- discovered this after one comment strip session didn't fix script from load failure.