This posting is older than 6 months and can contain outdated information.
Thanks for asking.
AppleScript works by sending a message to the targeted application and waiting for a response. If you send a command to a hanging application, it won't send a response. This will then also lead to a hang in the application that executed the AppleScript, because it now waits for a response that will never come.
You can specify a timeout after which AppleScript stops waiting for a response by surrounding your code with "with timeout of X seconds" / "end timeout". Please see
https://developer.apple.com/library/mac/#documentation/applescript/conceptual/applescriptlangguide/reference/ASLR_control_statements.html
for Apple's reference. Depending on what you do, you may also look into "ignoring application responses".
However, a script for quitting another application that depends on the target application to respond to messages while it's already hanging can't work as the application in question is already unresponsive when the scripts tries to send it a message.
Best regards,
Felix Schwarz