Just imagine you're standing over the shoulder of someone controlling the enemy, but who has never played the game before. You have to tell him what he should do.
...
Ok. Look, he's over there. Rotate your ship towards that direction. Now apply your thrusters. When you get within range, fire. Oh. He moved. Ok. Reverse thrusters. We have to avoid the gravitation field of that star. ... etc.
Once you figure out how the enemy should behave. You have to define the rules he must play by. A really simple example is the "house rules" for the card game "blackjack": "The dealer must hit until the cards total 17 or more points."
AI is one of the most complicated things even in modern computer science, but most AIs just have to make 3 things "Walk, turn, shoot" that´s probably what you are making?