The Freeze method is not definitely what you are looking for. That’s for client-simulation communication purposes.
I believe that in any case it’s not possible to stop a robot in middle of a statement execution, but between statements it might be…
I don’t have now time to test it but it might be worth trying to disable the executor with “IRobot.Executor.IsEnabled = false” and then enable it again and use IRobot.Executor.Continue() method.
IRobotExecutor.IsEnabled = false will not pause a robot program. It is used to define if the executor will execute its program. If the program is already executing, there is really no way to stop it within simulation.
I’ve made something a while ago, what you might could use.
It stops the Robot on a Collision, and continue to run on a signal, but the problem with it, was that the Robot forgets the last location it was heading towards.
I stopped working on it, but if you can improve it I would be happy to see the result.