Here's an attempt at addressing your question about records that are in the -7 and 7 seconds surrounding the trade (I assumed you counted the trade time as 0, and those combined made up 15 seconds, but you could change accordingly).
Since you are looking at ranges, there might be overlaps, so there is no point in checking a bunch of ranges, but rather the ranges that will encompass everything you need. So we create a helper function that merges ranges of time. Note that it assumes a) that your starting point is < that you ending point in each range, b) that you have fed in the ranges by ascending starting point. This can definitely be improved
//borken up into 2 lines for stackoverflow formatting /ease of read
mergeranges:{(enlist first fw){
(neg[d]_x),enlist @[y;0;:;(first y;first p) d:first[y] within p:last x]
}/1_fw:flip x}
So for example if we had the following ranges
[0, 2]
[3, 4]
[4, 6]
we really should just check [0 2] and [3 6]
q)mergeranges (0 3 4; 2 4 6)
0 2
3 6
q)\S 1
q)t:([]time:til 100;status:100?10; px:100?1.)
q)-7 7+\:exec time from t where status=0
10 27 32 35 36 43 68 70
24 41 46 49 50 57 82 84
q)mergeranges -7 7+\:exec time from t where status=0
10 24
27 57
68 84
q)5#select from t where any time within/:mergeranges -7 7+\:exec time from t where status=0
time status px
----------------------
10 1 0.1634704
11 5 0.7766767
12 6 0.8928093
13 6 0.6203577
14 3 0.07747125