Hmm, this isn\'t really a spam detector or anything, just a query blocker. If you meant to make it a query blocker, why not just decline all messages? You should also include the on *:open event. When first opening queries. Then you wouldn\'t have to use the on text event at all.
@ the code, you aren\'t unsetting variables, and why not store these nicks in an ini file or txt file and use $read/$readini to check? It\'d be pretty cool to include a dialog, but that isn\'t imperative. One last thing, you should use groups to disable/enable the snippet. ;)