[Quark] How to capture key or buttons pressed?

What I want to do:

  1. Launch the print dialog
  2. Let user enter their parameter
  3. Capture the settings onto memory
  4. Then carry on to the printing process

The sample script looks like this:

tell application "QuarkXPress Passport"
	activate
	tell document 1
		tell application "System Events"
			tell process "QuarkXPress Passport"
				keystroke "p" using command down
				repeat
					(*
					here is where I need the system to capture user's certain click (eg. click on button "capture Settings")
					and then the script will exit from the loop
					and continue to process
					*)
				end repeat
			end tell
		end tell
	end tell
end tell

But I struggled hard yet could not find a solution for key pressed or button pressed then exit from the loop. Hope someone can help me to solve my problem.
Thanks in advance!