Waiting is pretty easy. You can use the wait function for that:
http://www.conitec.net/beta/acrt-wait.htmPassing negative values to wait will wait the absolute value in seconds.
Passing positive values to wait will wait the given number of frames.
wait(-0.5); // waits half a second.
wait(13); // Waits for 13 frames.
Please use code tags when posting code.