I would throw away the PLC ladder logic and get or write a sequence of operations to use as my template.
If you try to make a state engine work like ladder logic you will lose the benefits of state and make a lot more work for you and anyone who touches the program after you.