Try using this:
on *:TEXT:*test*:#:{ /msg $chan Thanks $nick $+ , It works }
then get someone else (you can't get this event to activate when you say something in a channel) to say something with the word
test in it (EG: "This is to test your script")
Hope it helps you