I used a similar algorithm when developing a Chrome extension a few years ago:
https://chrome.google.com/webstore/detail/auto-highlight/dnk...
Longer sentences had an inherent advantage, so I controlled for that by reducing sentence scores as a function of the sentence length.