Your explanation is a bit vague, but to me it sounds like your issue could be solved with a simple if/else?
I imagine you’re familiar with that command, though, so that probably doesn’t do it for you.
Have a read here: UR3e, Inspection program, Jump position - #4 by laska
This could be the same thing you’re looking for, since you mention goto.