How to find an 'optimum' minimum difference value to identify the closest similar points on a plot? Data Set
I have asked a similar question and the data set is same, here.
The Goal

In the given plot, you can see there is a loop (all the points in the blue tiles make 1 big loop) i.e. the plot starts from the coordinates  relative.v = -0.7?, gap.dist = 14.?? and after some time returns back to this location.
If I sort the data using relative.v in ascending order and then find the differences between the consecutive points, I will get a minimum absolute difference which means that those two points are closest on x-axis.
If I do the same for gap.dist then I'll get the two points which are closest on y-axis.
But the two points on x-axis might not be same as y-axis.
My goal is to find those two points which give me kinda "combined minimum difference" i.e. the points which actually represent the start and end of the loop.
Problem
Achieving the goal using the plot is very easy. It is simply just looking at the plot and finding the start and end of loop. But I have thousands of plots which makes it impossible to manually find the relevant points.
The answer on the referred stackoverflow page suggested to use some kind of thresholds based on the minimum differences from actual data. This works for few plots but not all.
Question
In Mathematics, is there any approach to find such a "combined minimum difference" or the closest points which indicate the start and end of the loop? Please help if there is any.
Note that on a perfect loop, the start and end points will be same and the difference will be zero.
Edit
To further clarify the question, imagine a plotted circle. We can take any point on that circle which represents both the start and end of this loop (circle). For this particular case, the 'closest' points are where both the minimum difference of relative.v AND the minimum difference of gap.dist are zero.
In the given plot, however, there are no such points and therefore I need to find the closest points representing the start and end of loop using a different strategy.
 A: The naive thing is to calculate the distance between points in the plane and find the minima.  It requires you to consider all the pairs of points, but it doesn't look like you have so many that $n^2$ is a problem.  You also have to decide what the relative scales should be in the two axes.  Since the overall range in relative.v is $6$ and in gap.dist is about $40$ I might weight the difference in relative.v by a factor $7$ or $8$ more.  
Another issue is the time sampling.  At the crossing near $(-1.5,26)$ it looks like you got two points very close to each other, but if the timing had been different they might be further apart.  At the crossing near $(-0.7,14)$ the points are denser (was the object moving more slowly?), so you are guaranteed a close match.  
Finally, whether there is a loop may be problematic.  The two I cite above are clearly loops, and there is a crossing near $(-2,20)$, but are there loops at $(-2.6,36), (-2.4,25),$ and $ (1.8,21)?$  You also get a close approach near the $(-2.4,25)$, but they don't cross.
A: Based on the clarification you've provided, here is an elaboration on Ross's last comment.

Suppose you have the set of points $(x_1,y_1),(x_2,y_2),...,(x_n,y_n)$. We define a crossing event as being when a pair of points are within some small distance $D$ of each other.
We calculate the distance between the i-th and j-th points as follows:
$$ \mathrm{distance}(i,j) = \sqrt{(x_i-x_j)^2+(y_i-y_j)^2} $$
Then here is an algorithm to find the starting/ending point of the largest loop:
moffset=0
mi=0
mj=0
for i=1 to n
   for j=i+1 to n
      d=distance(i,j)
      if d < D
         offset = j-i
         if offset > moffset
            moffset = offset
            mi=i
            mj=j
         end if
       end if
   end for
 end for

After running this code, the 'starting' point of the largest loop has an index mi, and the 'ending' point has an index mj.

Just a remark: you will be able to speed up this code by removing the square roots. You can do so by replacing, in the above, $D$ with $D^2$, and defining the distance to be
$$ \mathrm{distance}(i,j) = (x_i-x_j)^2+(y_i-y_j)^2 $$
