I don't understand what you want to do. What do you want to use JDL_ApplyRange (or the internal ApplyRange) for? What are you doing that with it that will affect the frame count?
The filter you
apply with JDL_ApplyRange shouldn't affect the frame count. You can do whatever you want to the clip before or after calling JDL_ApplyRange, though.
That said, it's probably a better idea to do IVTC early on so you don't waste time filtering frames that will be removed, and then figure out the appropriate frame numbers to give to ApplyRange/JDL_ApplyRange/whatever in the IVTC'd clip.
BTW, why isn't Trim reliable? If you're referring to my
Caveats about using Trim in functions thread, then you've misunderstood.