Line spacing rather depends on the amount of text, that is, the number of rows. A simple example: hrenachit double spaced in a paragraph of three lines is silly, but if the text itself is long, very approx.
In General it is quite difficult to automate, as the large role played by the type that is drawing letters. Very roughly they can be divided into two types: (a) fonts, which is much higher lowercase to uppercase (and lowercase - long extended elements) and (b) the rest. Setting the leading they will be different; the first does not require a particularly large value and size, they may be significantly less (a strong contrast between letters improves readability).
Also, it would be good to consider not only the text settings, but its remoteness from other environment. Often push it off the bolt, breaking the visual connection, and although the text is laid out fairly well, but in the context of page harmony is destroyed.
But if you find a way to automate the calculations, let me know please)