Not a answer for you yet, but it took me a while to discern what your FORTRAN-ish (and MATLAB-ish) code for nebs1 is doing. I think it's simply the following:
data = Import["~/Downloads/x_y_points400.txt", "Data"]; (* where I downloaded the data file *)
vecMatDist[vec_?VectorQ, mat_?MatrixQ] := EuclideanDistance[vec, #] & /@ mat
nebs[i_] := 
  Flatten@Position[vecMatDist[data[[i]], Delete[data, i]], _?(# < 12 &)]
list1 = nebs /@ Range[Length@data]
After importing the data, this code selects, for each i, all those indices j other than i for which the Euclidean distance from the ith data point to the jth data point — the square-root of the sum of the squares of the differences of their two coordinates — is less than 12.
Is that what you intended to do? (I ask because the result is somewhat different from what you found!)
If it's what was intended, mow make the two functions I defined take an additional argument, namely, data, and make the constant list list1 (or a better name) a function of data as well. Then similarly for the remaining functions.