Algorithm for "Swiss teams" (bridge)
Specifically this looks like the Stable Roommate Problem (SRP). Alternate the order of preference based on position in a list sorted by distance from the total score. I.E., imagine a list with the following scores:  

1, 3, 18, 19, 20, 21.  

Then the preference list would be:  

1: 3, 18, 19, 20, 21
3: 1, 18, 19, 20, 21
18: 19, 20, 21, 3, 1
19: 18, 20, 21, 3, 1
20: 19, 21, 18, 3, 1
21: 20, 19, 18, 3, 1

For more accuracy use the Stable Roommate With Ties (SRT) algorithm.

The way Swiss Teams differs from SRP is that not everyone will be listed. That is, if the teams with scores 20 and 18 have played each other already then neither list each other as preferences. It's possible that SRP will still give the correct result but it remains to be verified.