I was having the exact same problem once, and my solution was to give each ship an offset vector which represented how much the ship had to deviate from its course. The vector was zeroed at the start of each AI pass, and then you go through all neighboring ships in range, and add the vector between them and your ship scaled by a factor determined by their distance to you. This means that if there is another ship at both your left and your right, and they are at equal distances, the net offset will be zero. If there is one behind you and one to your left, the offset will be to your upper right, etc. If you need the offset as an angle, it is quite easily done with some trigonometry, followed by adding the offset angle to the facing of your ship to get the new facing. You might have a problem in the case where two ships are on your front left and right, and the best path would be to pass between them (while the offset vector points backwards), but it should be possible to fix with some exceptions.
Sorry for the semi-necropost, i hope it works out for you.