OK this is a bit frustrating. There seems to be no reliable way to put a "wait" command in a loop and have it behave like a procedural language would behave.
For example, in the above capx, what if instead of having it call the clean function when you click the mouse, you wanted it to call the clean function, wait 0.1, call it again, wait 0.1 again... say, 4 or 5 times?
You can't go
repeat 5 times
call "clean"
wait 0.1
It only goes once.