You dont need two = in this one. !==
one = is enough. !=
And if $2 is null, then it will halt the rest of the code, so no need for != $null since it will never go there as long as $2 is $null.
on *:text:*:#tristansroom: {
if ($1 == !hug) && ($2 != $null){
.notice $nick Command incomplete. Syntax: !hug <Username>.
if ($2 !== $null) {
if ($2 !ison $chan) { .notice $nick Sorry but user $2 is not in $chan }
else { .msg $chan $nick goes and hugs $2 tight! }
}
}
Untested, but i think it will work.