I don't see anything wrong with using that macro, but I do have an alternative that I think is more flexible.
Depending on the situation this may not work, but here is the same result using lookup:
\define myfun(x)
<$vars u={{{ [<__x__>lookup:$x$ doesn't exist[value ]] }}}
\end
then you make a series of tiddlers with the titles 'value one', 'value two', 'value three' with 1, 2 and 3 in their text fields.
The downside is that you can't distribute it as just the macro, the benefit is that you can extend it to as many options as you want without editing the macro.