Usually mechanics like this are done with instance variables and timers. Say, the enemy may have State and Direction instance variables.
When it sees the player - set State to "attack", stop Bullet etc.
When the player is no longer in LOS - set State to "patrolling". Depending on the Direction variable set mirrored/not mirrored, re-enable bullet.
On collision with walls - change Direction value, start a timer to resume movement.
And don't use "Wait" action, because you can't control it. If the player appears in enemy's LOS during the 2s delay, you won't be able to cancel waiting actions. So always use the Timer behavior to schedule events.