It must also be able to acknowledge that custom layouts will exist as well that a mod may want to provide numerous resolutions for that won't be in alignment with either FS1 or FS2. So, it must also be able to parse in a single resolution custom hud gauges table/tbm and from that, be able to generate output for that hud layout at the specified resolution (or resolutions).
The spreadsheets, too, have limited ability to cope with custom HUD layouts... try setting the wingman display on the left of the screen, for instance (enter 5 instead of 932), see what comes out. So just copying the arithmetic from there won't do the trick. But then how should it work?
The most obvious solution for fully flexible customized layouts would be to just scale the centre position of each gauge to fit the screen. But then the issue is that the gauges themselves do not scale. They shouldn't, too, but it complicates the math. Some things are supposed to line up (the threat indicators on the reticle, for instance), which won't be preserved with simple scaling. In addition, there would probably be gauges all over the screen, since 'closely spaced' at 1024x768 becomes a long way out at 1920x1080 (notice the difference between the in-game HUD config screen, crammed full of gauges, and the actual in-game HUD which is much more spacious).
So then it's back to "scaling by group", pretty much like the spreadsheets currently do it, but in a more flexible way. In the table to be parsed, there would need to be some indication (probably in a comment after each gauge) of which group a gauge belongs to, the centre point of the group would be calculated and then scaled. The X and Y offset of the gauge would remain constant wrt the group centre. This way, spacing is only introduced between the groups, and lined-up gauges remain lined up (if they're in the same group, obviously).
Thoughts, ideas, criticism?