Try this:
(defun c:s2o (/ a b c d el m s)
;; RJP » 2020-04-29
;; Could give bad results for multiple vertices that are within the 'search distance'
(cond
((and (setq d (getdist "\nPick a distance to search: "))
(setq s (ssget ":L" (list '(0 . "POINT,LWPOLYLINE"))))
)
(foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex s)))
(if (= "POINT" (cdr (assoc 0 (setq el (entget e)))))
(setq a (cons (list (cdr (assoc 10 el)) e) a))
(setq b (cons (vl-remove-if '(lambda (x) (/= 10 (car x))) el) b))
)
)
(if (setq b (mapcar 'cdr (apply 'append b)))
(foreach p a
(setq c (mapcar '+ (car p) '(0 0)))
(cond
((setq m (vl-some '(lambda (x) (if (equal c x d) x)) b))
(setq b (vl-remove m b))
(entmod (append (entget (cadr p)) (list (cons 10 (append m (list (last (car p))))))))
)
)
)
)
)
)
(princ)
)