The way it should work is every ai module holds their own state. So when you do pop you'll return to the previous ai's state, basically the memento pattern. 

Its ok for some functionality/code to be the same across ai packages. but I would suggest using the strategy pattern to assign a state to a package rather than keep the code across all iterating classes. 

For example aipursue should hold its own state for running. But ai activate doesn't need a run flag state so we just ignore adding it to the class.