Yes, sounds cool, but it has two problems... to which I don't see any solution.
First problem is step 1 ("select several soldiers").
I have a lot of soldiers and without the sorting functionality, it is difficult for me to decide which ones to select in the first place. It takes ages to manually go through all of them and decide who to take... remember this was meant to help you pick your crew... not to just reorder an existing pre-selected crew.
Second problem is step 2 ("auto arrange").
I work in IT for many years now... and I have never seen any non-trivial algorithm "intelligent enough" to replace my own decisions.... even if this was implemented, in 99.9995% of cases, I would have to make manual changes... which makes it useless.
In my games never been more than 20 soldiers per one base.
Therefore most of them I know after several missions.
But if it's a problem, you can use XcomUtil_Statstrings.rul for picking a good crew.
"Sort by" is not intended for picks a crew by design. "Sort by" designed only for reorder.
Therefore you need 12-13 steps and many-many clicks (each time) to get a crew of dream
Even if in most cases you need only add 1-2 soldiers instead wounded or dead ones.
Perhaps, manual reorder will be faster. Therefore I think this option is useless.
Described above algorithm not designed for replace your decisions. The algorithm just repeats your decisions. Therefore the statistical model should be trained before use.
This is some kind of expert system, but very simple. I not expect 100% accuracy, but 80-90% will be fine.
The idea is simple:
1. collect stats data of your soldiers and positions which you choose for soldiers. It's easy.
2. when you press "auto-arrange" will be reproduced your decisions: fit the soldiers stats to match to the collected stats data. If you think about it a little, the algorithm will be obvious.