Why can't you just use:

if ((%var == blah) && (%var = %var1)) { commands }

Is that what you mean?