Considering I understood correctly, here is one (of the many ways) that this can be done:
[attachment file=”RepeatUntil.png”]
Once the initial condition “Distance 500” , is false. You can also make the Sequencer “Dynamic” if you want to continously evaluate the Distance Check.
Let me know if that works for your case.
Thank you.