wouldn't it work if you did this:
($nick($chan,NICKNAME,') == $true)
From what I can tell, It return's $true if its correct and $false if not, and when its acting as '0' instead of the nick it returns the number of 's in the room.
I think this is a bug, allthough fixing it would break more scripts than it would help.