Ok found the solution instead of using $nick, I must use $$1 in nicklist popup for the iif to work properly now this works:

Code:
menu nicklist {
  $iif($hget(pmusers) == $null, PM rights)
  . Create access rights database: hmake -s pmusers 100

  $iif($hget(pmusers) != $null, PM rights)
  . $iif($hfind(pmusers, $$1) != $$1, Give, Remove) {
    if ($hfind(pmusers, $$1) != $$1) {
      hadd pmusers $$1 $$1
      .notice $me $$1 got now PM rights.
    }

    else {
      hdel -w pmusers $$1
      .notice $me Removed PM rights from $$1.
    }
  }
  .-
  . Remove PM access database {
    hfree -sw pmusers
  }
}