the AI should be capable of deciding not to shoot ships just because they happen to be closer if there's better targets slightly further away.Well the battle-line was about 20mkm infront of the ships it was defending up until I tightened the formation closer to the alien homeworld. After that, they actually started targeting the carriers.
There are a few applications.Actually you reminded me I have used formations, Combat Air Patrol, a sensor equipped fighter or LAC screen just outside the range of my Carriers. I didn't really use it enough to have an opinion on how effective it was, but the basic idea was that the fighters would be harder to spot while at the same time having good sensors.
If you rely on area defence, you can put your most important ships in the back.
Various small ships that you expect to be too small for enemy ASMs to target can be deployed forward, fast area defence fighters may try to chase missiles.
But mostly, the main reason to bother is because it looks cool.