It seems like the wait statement does not count while a dialog sheet is open. This code does not resume after the wait statement until the dialog is closed some other way:
Is there an alternative to my code that will close a dialog after a specified time period? I would like to run other code in the background while the dialog is open. The purpose of this is to prevent stray mouse clicks from interfering with the code that is running.