You have a number of options depending on exactly where you want the "printing out text" to appear on the page.
1. The <<linkreplace>> macro suggested by @Chapel
This macro will replace the Link Text with the content of the macro's body.
<<set $variable to "value">>\
<<linkreplace "Option 1">>
\<<if $variable is "value">>Replacement for link text<</if>>
<</linkreplace>>
2. A <<link>> macro combined with a <<replace>> macro
The <<replace>> macro needs a target (like a span element with an ID) and will replace the current contents of that element with the macro's contents.
<<set $variable to "value">>\
<<link "Option 2">>
\<<if $variable is "value">>
\<<replace "#output">>
\Replacement text for output span element
\<</replace>>
\<</if>>
<</link>>
<span id="output"></span>
... the ID'ed element can be positioned either before or after the link itself, and you can replace the <<replace>> macro with one of the other DOM Macros