JavaScript is asynchronous, you cannot "pauses" execution. Moreover, while javascript is running the entire user interface freezes, so the user cannot click the button.
Once you have registered the callback to the click event, the program continues its execution.
The following lines in your script
_wait = false;
_response = "ok!"
will never get executed until the Popup.Show
function returns.
Perhaps this Nettuts article about javascript event programming will help you understand the paradigm.
Here is a try to fix your code :
Popup.Show = function(text)
{
/* code to draw the window */
// bind click event
var myPopup = this;
$("#button-ok").on("click",function()
{
// this code will be executed after Popup.Show has return
myPopup.response = "ok!"
myPopup.Close();
}
}