Need sugestion on behavior tree problem.

I have been working on enemy Ai recently and I stubled on serius desing problem. I’m trying to make so that when certian number of enemis enter “Attack State” the rest will enter “Spectate State” and just walk around the player. Heres the Serwice that makes this:

My problem is that I don’t know how to make them stick to these roles and change only when the place is “free”. Is behavior tree good for it ?