Check all your command line's need to have space between variables and "quotes"
;bad (command _trim"" ssdl1 ssdl"" "f" c1 c2"")
;good (command _trim "" ssdl1 ssdl "" "f" c1 c2 "")
space space space
I counted about 5 lines that need space
--edit
Its also a good idea to add "_non" when feeding points into command line because they do snap to entity's that are close depending on zoom level. even if osnap is toggled off.
(command "line" "_non" p1 "_non" p2 "")
--edit -- edit
just looked at the code a bit more and move all the creating of the blank selection sets outside of the loop you only need to do that once. and it might clear out the selection set.
Depends where you are in the world here in AUS its Ch 1234.45. Postal addresses in remote areas on roads are like 1092 meaning 10920 m from a start point.
@Noor-Cad I didn't understand that in your short post and it wasn't in the original request for the program. This can be done, but you'll have to wait until I have some more time.
Of course you could try to learn from it and add to the code yourself. That is, after all, what this forum is for.