Add the "StateChange" function to the async comand manager to differentiate
between state changes and script exit/reset.