"Pause" code execution, and wait for result

Visual Studio had a command “showDialog()” which allowed you to show your form as a dialog box on the screen. The advantage to this was that the code calling the dialog box would pause, stopping execution entirely until the dialog box closed. The benefit was you could write your code as follows (made “actionscriptey”):

var result:DialogResult = form1.showDialog();
if (result == DialogResult.OK)
   { trace("We are okay for launch"); }
else if (result == DialogResult.CANCEL)
   { trace("Launch aborted."); }
else
   { trace("Launch postponed."); }

This code can be restructured as event listeners, but it was REALLY convenient being able to pause the running code in mid execution, open up this dialog box, run all the code in that dialog box, and wait until a result came out of it before continuing the actual code.

It might be possible to do something like this:

var form1:DialogForm = new DialogForm();
form1.showDialog(); //showDialog will set the property "open" to true

//This might get CPU heavy and cause timeouts. :(
while (form1.open)
{
   //Loop infinitely until the dialog box closes
}

if (form1.result == DialogResult.OK)
   { trace("We are okay for launch"); }
//...

Does anything similar exist in ActionScript?