You can use the ! prefix in front of variables and identifiers in an if-then-else statement to negate a value.
IF:
if (
$nick isop #)
nickname v1 [is an op on] channel v2THEN ( Using the NOT prefix "!"):
if ($nick
!isop #)
nickname v1 [is NOT an op on] channel v2