It was asked a while ago, and I can't find it anymore on these forums.
Fortunately, the entire discussion is saved on http://objectmix.com/adobe-indesign/762456-script-alerting-me-about-excessive-tracking-tex t.html -- 2 pages, nearing the end you will get some tips on using textStyleRanges.
Are you sure you want to allow tracking between -20 and 20? Everything nearing +/- 10 sounds highly suspicious to me.
Here it is on the new forums. The code got totally mangled though!
I'm really glad I have my archives of the old forums saved in Thunderbird (since 05)...