This is a Fargo based race calculator that the USA pool league uses. Since it's available online I'm going to assume that it's not proprietary...
Enter the 2 competing Fargo ratings and choose either a shorter or longer race. The calculator will give you a race in points.
The player who wins a game, regardless of how he wins it gets 14 points. The losing player receives one point for every ball he made. In 8 ball that includes balls made of his suit by an opponent, on the break or throughout the course of the game.
In 9 and 10 ball balls pocketed on a scratch are dead and do not count at all. In 8 ball all balls pocketed count regardless of scratch or not.
The first player to reach their points wins the match. If however both players are within 14 points of their total before one gets all their points, it becomes hill/hill and who ever wins the last game wins the match regardless of the final point tally...
In my experience it results in pretty fair matches even with a large difference in player ratings.
Maybe something to try rather than reinventing the wheel...