I agree with Martin that for every new question you should provide the Prime sheet and also the necessary data file so that all members of the community have the opportunity to take part. The smaller and simplified the sheet, the better!
Furthermore you can't expect us to keep track which file was posted by whom in the past and keep all the files. Being lazy by nature I don't delete the files as regular as I maybe should and so your new files worked even though you did not provide the necessary Excel sheet. But the missing sheet sure would have hindered other members to try to help.
Concerning your new question I don't think that i can help. The function "connect2" you reference is a function which creates the data structure necessary to plot the line segments from every green point to the red LINE nearest to it - that way visually showing hat minimal distance.
The function is called "connect2" because it followed "connect", which would do similar but by connecting each green point and the nearest red point.
I don't see how your new question would relate to that function. Actually I don't understand what that question would be all about.
What should "find the distance between the red point and all the green points come before it regardless the min distance" mean?
How would "before" be defined?
As far we cycled through all green points to find the red line closest to it. Not you want to cycle through the few red points(!?) and find ... what?
Again, as you reference the function "connect2", I have no clue to what you may need.
In case you just want to create a list of all green points within a certain section, we could add the information, if the point is left or right of the red marker line

and use this information to select all points within a section

Example:

In the attached P10 file I got rid of all regions not relevant to the question. If you can reduce the sheet further, please do so before you re-up it again. Smaller sheets make life a lot easier!