12:10-73/256 is not the same ratio as 14:12, although it is very close.
Is the intent to always have the run be 12? That would not be hard to do, but you would need to specify the acceptable tolerance for the rise. I'm thinking that field measurements should not be to 1/256".
I think it might be better to re-write than to try to modify the existing code, but we would need a clear statement of what output you'd like. If there is a list of standard ratios you use it might be easier to get the angle of the selected line, normalize it, then match that to the closest angle from the standard ratios.