Is this within in an Xlate? If so, it should be fairly straightforward. Simply use the IF command tool to configure the statement in your xlate checking for not equal to @null in TXA:13. Pseudo coding the logic would yield something like
if TXA:13 not equal @null
COPY TXA:13 to TXA:12
COPY =A to TXA:17
else
COPY =S to TXA:17
I’m assuming when you say “TXA|13 is blank”, you mean is null (not valued).