After saying in several posts that sheets can’t be application-modal, it turns out they can. The sheets must be custom windows (not NSAlerts or open/save panels). You show the window as a normal sheet, then tell the app to run modal for the sheet. A handler connected to the button to dismiss the window then calls stopModal. So:
on showSheetModal_(sender)
tell current application's NSApp to beginSheet_modalForWindow_modalDelegate_didEndSelector_contextInfo_(messageWindow, mainWindow, missing value, missing value, missing value)
tell current application's NSApp to runModalForWindow_(messageWindow)
-- execution pauses here because this code is outside window's control
tell current application's NSApp to endSheet_(messageWindow)
tell messageWindow to orderOut_(me)
end showSheetModal_
And the close button handler:
on closeSheet_(sender)
tell current application's NSApp to stopModal() -- so above code resumes
end closeSheet_
The things you find when you read the documentation…