I tend to use things like:
; do the stuff that depends upon the transient having run
If the tran didn't run because of a problem (you could use a similar approach for other analyses), there will be no results in the simulation result database - so checking for it is an easy way of catching gross failure.
Alternatively, using the approach proposed by Quek (the unless bit) is a good idea. I'm less keen on the %L approach - it's less flexible in how it can be formatted, and it doesn't help if you tried doing:
outData=v("/out" ?result 'tran)
in this case the double calculation will fail if the tran results are not present, because it will try to do nil*2.