You can combine those two if statements with && and thus you save yourself a bracket:
if ($network == NETWORK NAME) && ($nick == NICK) {