If you look at your first line, you're looking for !test *
This is looking for !test, followed by a space, which can then, optionally, be followed by something else.
What you've done, is forced the command to require the space before it will trigger.
Just take the space out and it should work fine:
on *:text:!test*:#: {
if ($2 == $null) { msg $chan Please enter !test [user] }
else { msg $chan hello good job }
}
Hopefully this helps