the easy way to do, is to make the enemy character move automatically, once it hits object (pipe lets say) change the angle of movement opposite ( 0 is right . 180 is left, 270 is up 90 is down) try doing it with bullet behavior and switch set angle from yes to no ,and add platformer behavior so it stays on ground, the platformer behavior of enemy should have controls set on custom, if you leave them on default when u press keys arrows, will move as a normal character you don't want that.
make sure the floor or ground has solid behavior.
when layout starts set angle of motion from bullet behavior of the enemy to 0 so it starts toward right side, then you add the collision detection and change movement direction from bullet behavior of the enemy to 180-self.bullet.directionangle ( that means if enemy has current angle 180 minus 180 from the front will be 0 if the current angle is 0 minus 180 from the front is 180 ) gluck hope it helped you!
i doubt you'd manage to understand so i made a capx for you Download