That will only trigger on exactly "!test" and nothing more. You also need to specify where you're msg'ing to.

Code:
on *:TEXT:!test *:#:{
  msg $chan $2
}