Hi,
There are many ways.
One way:
You can use the Bullet behavior and say:
CONDITION: ENEMY Y > ???
ACTION: ENEMY bullet angle of motion = -90
CONDITION: ENEMY Y < ???
ACTION: ENEMY bullet angle of motion = 90
Another way:
You can setup invisible objects as a boundary and when your ENEMY collides with the bottom boundary tell it to go up (bullet motion angle -90) and when it collides on the top one tell it to go down (bullet motion angle 90)
The method you choose to use will depend on your project.
Good luck!