It returns true always because that event will only trigger if you type #XYZ.

on *:INPUT:#XYZ: {

So if you type /#xyz this event wouldn't evaluate the if statement. mIRC would simply skip it.