Hmm... bit of an awkward one this. Technically, what you have already is probably the fastest way to do it with 100% accuracy.

DaveC's will work, however, it requires that $1 doesn't ever have a space in it otherwise it could break a lot.

Here's my version of it, it simply requires that there isn't a linefeed (newline character) inside any of the variables or $1, which isn't impossible, but very very unlikely.
Code:
negcheck {
  var %toks = $+(%variable1,$lf,%variable2,$lf,%variable3,$lf,%variable4,$lf,%variable5,$lf)
  %toks = $+(%toks,%variable6,$lf,%variable7,$lf,%variable8,$lf,%variable9,$lf,%variable10)
  if (!$wildtok(%toks, $+(*,$1,*), 0, 10)) { echo -s yadda yadda }
}

It could also be done with $regex instead of $wildtok but it's a little bit slower so I didn't show that one.

If you want to check every variable with a name starting '%variable' then you can use this:
Code:
negcheck {
  var %i = 1
  while $var(%variable*, %i).value != $null {
    if ($1 isin $ifmatch) return
    inc %i
  }
  echo -s yadda yadda
}

This one will also work no matter what $1 or the variables contain, however it's about half the speed of the others.


Spelling mistakes, grammatical errors, and stupid comments are intentional.