Hi mestrejedi3221.
First I would include the platform behavior to enemies (or 8 directions if it is no platformer), it will be much easier to control their movements this way (don't forget to put "Default controls" off).
Also use an instance variable in enemies to memorize the player even if he left the LOS, being able to run after him then. Let's call it "Memory" (initial value = 0)
About shooting I would do something like :
("-" represents sub event)
if Enemy has LOS to player : Set memory = 1
- Enemy compare X : if greater than Player. X : Set mirrored
- Enemy compare X : if lessthan Player. X : Set not mirrored
- Every 3 seconds : Spawn bullet
About moving to the hero :
if Enemy has NOT LOS to player :
and Enemy memory = 1
-Enemy compare X : if greater than Player. X : Simulate control Left
- Enemy compare X : if less than Player. X : Simulate control Right
Does it help ?
Vega