After a bit of research and some trial and error I found that the following VTL works:
<CodeTemplate>
<![CDATA[
#if ($textExample.empty=="false") $textExample #else NULL TEXT #end
]]>
</CodeTemplate>
So this piece of code checks whether the Input Text variable is empty/missing ("true") or non-missing ("false"). I wanted to use this for optional macro parameters that require text when creating a Tasks to create a standard macro wizard.