$level is not the right identifier

$level(address)
Finds a matching address in the remote users list and returns its corresponding levels list.
$level(*!*@mirc.com) returns =5,10,20,21,32
Replace "
$level" in your code with "
$ulevel"
$ulevel
Returns the user level that was matched for the currently triggered event.