Can you give a specific example of what you want to do?
If by slash command you mean macro, you can't (easily) react to events like SPELLCAST_FAILED with a macro since events get sent to frames which are made in an addon's xml.
You want to generate a synthetic event to be processed by an XML frame's OnEvent code? (A little like XSendEvent from X11 fame, right? Might not help if you don't program Unix graphics apps...)