Something extra would be to limit the search to only those items that intersect a perpendicular point to the original point.
I'll try (in my poor English) to explain what I understood and and the way I tried to answer it in my codes.
The way is to search only lines parallel, on same layer, offseted within the search distance,
and wich cross the perpendicular line (2D) or plane (3D) to the original line at original point.
Example : original line is from 0,0 to 120,0 original point is 90,0 search distance 20.0 a line from 100,10 to 200,10 should return 10.0 without "extra", nil with. If original point is 120,0 both should return 10.0
I edited my last code this way : replacing nil by T in the (inters ...) expression will retain only lines crossing the perpendicular plane to original line at picked point..