You should use instance variables for each zombie. You can set several sets of coordinates to create 'instance unique' pathing. Couple that with instance style behavior modifiers and you can get cool swarm effets. Not everything is fitting in the image but this will give you the clue you need.
Here is a high level Heuristic:
- Create 3 sets of XY Coord pairs (Instance variables) for zombies.
- Create Instance variable for Mode.
- Check distance to player to toggle mode.
- If patrol mode Every X amount of second set 3 random locations nearby the and loop through them as goals to create a patrol effect.
White Larva "Plaguecyst" are using instance specific patrols and distance measuring similar to what you are thinking.
If you want your random patrol points to be in a circle you can limit their spawn location by using Pi:
Similar to this:
x = (cos(step*3.14159*2))*44+ Sprite2.x
y = (sin(step*3.14159*2))*44 + Sprite2.y