For your enemy spawning issues, are you creating them then setting thier X position to a random number limited to the siz of the frame, like this?
Random(640)
or
Random(Frame Width)
If so, you can fix it so that the enemies will always center away from the edges, like this:
Random(Frame Width -
Width of Enemy Obejct) + (
Width of Enemy Obejct / 2)
It's the same thing, but now it accounts for the width of the enemy that could stick out the edge of the frame, and it will keep that from happening. If you're good at math you will udnerstand how that works.
As for lives, TGF2/MMF2 have a built-in lives system for you to use!

All you have to do to use it is edit the starting # of lives in the application peroperties (Click your application icon in the tree browser on the left side, then under that click the different icons in the properties pane until you fnd one that has the lives settings). There is a "Score" object and a "High Score" object for you to use as well. There is also a "Life" object that you will want for displaying the lives.
With events, there is an object next to the keyboard object called the "Player 1 Joystick object". (if you add more players there will also be ones for players 2-4). With this object you can control the score and lives of your player.
I hope that explains it all! Good luck on your project!