@Brooks: I don't know precisely how you wish to define (within a range). I just hacked a quick Custom study, (Custom studies can be used in the sorting of TOS Scans) to look for %change in prior 90 bars (days) and fix a threshold (set to 10% here, that you can alter) that will effectively discard by returning a zero for those over that threshold (an attempt at what you may want for range) and provide higher weighting to lower percent changes. -- I used "Custom 1" see below:
# Brooks response for a custom thinkscript to aid in quantifying sideways movementPercent of stocks over LookBack bars(days)
# Must insure aggregation is set to days for bar to == days.
input LookBack=90; # Days
input PercentLimit=10;
def highest=highest(high,LookBack);
def lowest=lowest(low,LookBack);
def range=highest-lowest;
def lineinsand=highest-range/2; # pick mid point
def movementPercent=100*(range/2)/lineinsand; # How much movementPercent
plot Weighting=if (movementPercent>PercentLimit) then 0 else PercentLimit-movementPercent;
Pic of a scan setup: