You have lots of mistakes in this code..
1. If you have multiple enemies, event 20 will not work correctly, because it will only check StateTimer of the first enemy. But it will change the state for all enemies.
2. You should not deactivate the "wonder" group, because while some enemies may be in "pursue" state, others may still be in "wonder" state.
3. Enemy On Created is not needed in this case. But if you are going to use it, it has to be a top-level event, don't nest it under other events.
You need to change your code like this: