Code:
alias dialogexists {
  var %i = 1
  while ($script(%i)) {
    if ($read($v1,nr,/^(?:n\d+=)?dialog(?: -l)? $$1 \{$/i)) { return $true }
    inc %i
  }
  return $false
}
on *:start:{ set %userlist2.exists $dialogexists(userlist2) }

menu nicklist {
  $iif(%userlist2.exists,<your menu here>): <command here>
}