'is attack running' runs constantly and you probably don't need it. Also the every 1 seconds seems unnecessary.
I would start by adding the timer for 'Waiting' not a system wait. Then you can say on Waiting timer finished, if you are within distance, run the create object attack and then start the Waiting timer again, you don't need this state variable for attack tbh.
If you are not within distance then you can run a 'Searching' timer, I'm not sure what that means for the enemy but you can say on Search timer finished start the Waiting timer. Everything will then return to this Waiting state.
Whenever you start a timer you can set the state so you know what's going on. Right now it's looking a little convoluted and will be difficult to control for multiple enemies, but the above will help simplify. Also I would get it working with one instance of enemy before you try looking at multiple enemies.