Pause script while alert box is displayed

Pause script while alert box is displayed

It would be great if the scripts would wait for the user to press the "okay" button on an alert box, because if the script takes the user out of the place where the alert box is displayed, the user wont see it.
Maybe a pause statement....