You should also do a /closemsg, else a empty chat window will open, with no messages in it smile
Code:
on ^*:text:*:?: {
  if ($nick ison #chan) { .closemsg $nick | halt }
}