Unfortunately, you have no idea how complicated this objective is. Fortunately, TF2 community has some math geniuses who had succeed in development of this system. Hopefully, we will integrate Jon's system into TF2C in a near-ish future.
please for the love of benji... you can't base a matchmaking algorithm on some obscure thing some guy did for himself and nobody else seen what's inside that black box.
First of all, Jon has made this for the community benefit. It might look obscure for the most of users, but not for the devs who involved into this project. His system works. Yes, I agree, it is not ideal and has some flaws and I personally find some of them a quite annoying. But we don't have a better alternative, do we? And Jon could improve its algorithm in a future, especially if TF2C would be providing him the stats from advanced lobbies.
The goal of advanced lobbies is providing the best of possible competitive experience. If we will succeed in this, why players should care about any algorithms behind this system?