<p>I want to write something that acts just like confirm() in javascript, but I want to write it myself so I can skin the dialog box.  In having trouble thinking through how I would basically force the javascript thread to wait until the user responds and then return true or false.</p>

If I were you, I would look at one of the popular javascript libraries.  Most contain some sort of modal dialog.
A couple I found for JQuery are
jqModal
and
SimpleModal
.
When you build the modal dialog, you will have to tie events to the buttons, so you would do something like:
```
```
function askUserYesOrNo() {
  var myDialog = $('<div class="mydialog"><p>Yes or No?</p><input type="button" id="yes" value="Yes"/><input type="button" id="no" value="No"/></div>');
  $("#yes").click(handleYes);
  $("#no").click(handleNo);
  myDialog.modal(); //This would have to be replaced by whatever syntax the modal framework uses
}

function handleYes() {
  //handle yes...
}

function handleNo() {
  //handle no...
}
```
```