From what I've read, scripting in WoW uses LUA while UI scripting in EQ2 is much more limited. I don't think what you're asking is possible in EQ2. There's a
very, very long thread about the spam problem though so I'm pretty sure they're aware of it.
These were my suggestions in that thread:
1. Tell throttling. Limit tells to one every two seconds (or some reasonable number.) This could easily be done within the client so it wouldn't even affect the server code. These spammers are obviously sending out hundreds of /tells per minute.
2. One click reporting. Reporting spam has to be quick and easy. Reporting mail spam is done this way-- you click on the spam button and you click a second time on a confirmation window. Reporting /tell spam takes far too long and you can't even /report more than once every 5 minutes when we get spam every 2 or 3 minutes! Petitioning takes too long and you can only have one petition open at a time. We need to be able to click on a name, report spam, and then click on a confirmation window. Done!
3. Automatic /tell gagging. After 25 (or some number) spam reports are filed against one account no tells are allowed from that account. If the account tries to send another /tell they get a polite response, "You have been reported by at least 25 players for spamming. You are not allowed to send any more tells. A GM will contact you on their findings. You may /petition for help if you think you have been wrongfully accused of spamming. Thank you for your patience." If one player griefs another player by reporting them for spamming... nothing happens. After 25+ players report one account for spamming, all 25 reports are grouped together and automatically filed as a petition that a GM can handle in one fell swoop, thus saving GM time in the process.