You can do this by starting at the first value and search forward while the difference is lower than your threshold. If the interval you searched in covers more than one value then you print these and a blank line after. If the next value after the interval is still inside your list then you repeat the whole procedure.
EDIT: assuming you have a list sorted in ascending order:
Code:
' set the threshold and number of items in our list
t = 5
n = 10
list(n) = list(n-1)+t
' search through the whole list
s = 0
while s < n
' find the end of the current interval
e = s
while list(e+1)-list(e) < t
e = e+1
wend
' if there were more than 1 item we print them
if e-s > 0
for i = s to e
print list(i)
next
print
end if
' step to the next item and repeat
s = e+1
wend