During case iii departures, the ai will fly the standard case iii departure automatically to the first waypoint. They will fly straight ahead to join a 10 mile dme arc around the ship (launch position) and then fly straight out to the waypoint once it has arced to the radial that joins the starting point to the first waypoint. It will then turn and fly on that line to the first waypoint. If your first waypoint is too close to the ship for the ai to do all that, then it ends up flying in circles. Try putting your first waypoint around 30 miles away.