With Stash you have always been able to create global variables and evaluate them in the same template using if/else conditionals:
{exp:stash:set_value name="var" value="cheese" type="snippet"}
{if var == "cheese"}
We have cheese!
{if:else}
Where's the cheese, gromit?
{/if}