Hank, It seems to me you need to set some rules, or rather conditions. something like this:

1) samples must be +- 10 of a target number to be included in the average
2) numbers outside the +- 10 will need to have 2 more samples within the new samples range to be considered a good sample.

That seems like it would weed out the rouge numbers. Now of course I have chosen random numbers. The 10 and 3. I don't really know what the numbers represent (I assume gutiar notes). Nor do I have a feel for how long a note will last. thats what drives the 10 number.