You're fighting with the Processor's internal management of its own states. If you open the event list and step through what happens when the operator drops off the box, you'll see that the token in Process Flow goes to the custom code that sets the state and then the Processor fires both its End Setup and Process Finish Events. One or both of these events is setting the state of the Processor after you've manually set it.
One way to fix this would be to wait until these events fire to set the state. In this model I added a Wait For Event activity that waits for the Processor's Process Finish event before setting the state.
state-mg.fsm
Matthew Gillespie
FlexSim Software Developer