Assuming that no one has any friends.......1 option would be to rank teams by T11 average Q then draw, randomly, 4 teams from the top 4/14ths, 4 from the bottom 4/14ths and 6 from the middle chunk.

To accomodate friends you'd need to have to count them in the range that they would have accoupied if they weren't friends. *clear as mud*

But ofc stand by for all the complaints from ppl with teams who can't compete