So, here are two ways you might set things up such that \dostuff is done when foo is false.
The "new conditional" method
If you know when foo is going to be set, then after that do:
\newif\ifnotfoo
\iffoo\notfoofalse\else\notfootrue\fi
And then use the \ifnotfoo test.
\ifnotfoo\dostuff\fi
The "else" method
Whenever you need to \dostuff, just do:
\iffoo\else\dostuff\fi
Is either method recommended over the other? If so, why? (Or is there another method which is even better?

\unless\iffoo. – Stephan Lehmke Jul 2 '12 at 11:50\unlessprimitive in e-TeX which negates a following\if.... Then you still can use\elseas well. – Martin Scharrer♦ Jul 2 '12 at 11:50