Script for QuarkXPress - Spell Check

I would like to write a script that would require the user to run QuarkXpress’ spell check before closing the file. Since I am a real novice, I need some samples to follow. I don’t want to make the script too complex - just runs spell check or returns a dialog instructing user to run spell check. I would need to afford the user to select “by selection”, “story”, or “document”. If I use the former, runs spell check, how do I avoid looping everytime the user choose to exit the file? Any and all assistance would help me to further learn scripting.