I have an application with a glitch – clicking its Quit button is messed up.
Choosing Quit from the menu or typing command-Q works fine.
I would like to intercept mouse clicks to the Quit button and send command-Q. It seems trivial, but sometimes users forget and click.
One of the glitches is that Keyboard Maestro freezes.
You can't – period.
Keyboard Maestro would have to be able to inject code into your app and attach to the quit button, and that's not going to happen.
What's the app?
I'd think that "clicking Quit and killing other unrelated apps" is a bit more than a glitch! Bug report to the app's dev team and try and get them to sort it out.