Macro output to select between two possible references?

So I wanted to remove a local variable from a macro:

Can anyone with more experience help me with what the proper solution without a local variable is?


Seems maybe this is the solution in my particular case, but does anyone have a more general solution? (Or is this the general solution?)