If you want it to do 2 different things, depending if there's text after the keyword, you can either have 2 separate events where one uses matchtext :!sub: and the other uses :!sub *:

Or you can have the search match use a regular expression. This one triggers only if !sub is followed by a space or by end-of-line. So it won't trigger for !suburban

Code:
on $*:TEXT:/^!sub(\s|$)/iS:#:{
  echo -s This event triggered by $nick using $1-
}


in the /iS the 'i' makes it case-insensitive, so it would trigger for !SUB and !Sub. The capital S makes it ignore color codes in the match, but still leaves the control codes in there. So this would match where a color or bold/reverse/italic code was touching the !sub as long as there was a trailing space. In effect, it makes the match be against $strip($1-) without altering the content of $1-

In your event handler, $1 would be !sub and $2- would be everything following it. $0 is the total number of parameters, so if $0 is 1 you know that there's nothing following the !sub word.