Newbie-Question about a Cancel button

I prepared a panel window with some buttons. Every button calls another applescript. Each script runs with the “on clicked theObject”. I made a status bar and a Cancel-button on the same panel. They are only visible when theObject is clicked. This works fine.
But I have no idea how to make the Cancel-button stopp the running script and after that load the nib again. I’m not allowed to make a second “on clicked” action in the scripts. I looked into the documentation but found no way to do this.
Hope, someone can help me out.
Thanks in advance

Dirk
http://homepage.mac.com/beweis


on clicked theObject
set visible of button "Cancel" of window "Panel" to true
-- the script runs
-- but how to enable the Cancel button javascript:emoticon(':shock:')
end on clicked

perhaps this will help

on clicked theObject
	if title of theObject is "Something" then
		do something
	else if title of theObject is "Cancel" then
		quit
	end if
end clicked