For closure on this topic:
At the moment it seems like there is no software only solution for this issue. It will require some relays and extra hardware to work
I ended up solving the underlying issue i had with external devices needing separate initialization after an e-stop event. I found a way for the devices to automatically restart and enable. However this was a much harder problem to solve than just halting and restarting the robot program.