The question boils down to the way commands are executed: the command start the process; when the script then get to the next command, is it granted -or not- that the last command is fully completed, icluding mechanical stabilization ?
It depends on the specific function and sometimes on the specific port. Because CHDK is hacked into an undocumented and poorly understood system, these things are often not well specified.
AFAIK set_zoom generally wait for the action to complete before returning. On some cameras, set_capture_mode can return before the mode changes is complete.
set_focus is more complicated. If the camera is in an auto-focus mode, calling set_focus from script should just tell the camera what focus you want to use for the next shot. The actual focus isn't updated until half shoot. If the camera is in MF mode (or AF lock in chdk 1.3) the focus should update immediately, and (AFAIK) set_focus generally won't return until the actual lens movement is done. In CHDK 1.2 and earlier, many ports didn't implement this correctly, so the behavior was even more random.