it's better to not understand the way code works. just go with it.
Anyway, the doevents issue stops the execution of a procedure in order to allow other things to process, whatever they may be. In this case, nothing will happen, as in...no processes need to run, and therefore the program's procedure is basically paused for 5 seconds. the timer starts and approches 5 seconds. when it's there, the loop ends.