First, we create a new if:

\newif\iffoo

We can now implement if not conditions by using the \unless primitive:

\unless\iffoo
...
\fi

@stephan-lehmke