This seems to do that, in very limited testing:
(defun C:FLP ; = Force Lines Perpendicular
(/ esel RL RLdata orth ss n L Ldata Lstart Lend StartCloser LsC LeC)
(if
(and
(setq esel (entsel "\nReference Line to make other(s) perpendicular to: "))
(= (cdr (assoc 0 (setq RLdata (entget (setq RL (car esel)))))) "LINE")
); and
(progn ; then
(setq orth (getvar 'orthomode))
(prompt "\nTo make other Line(s) perpendicular to it,")
(if (setq ss (ssget "_:L" '((0 . "LINE"))))
(progn ; then
(setvar 'orthomode 0); turn off
(repeat (setq n (sslength ss)); then
(setq
L (ssname ss (setq n (1- n)))
Ldata (entget L)
Lstart (cdr (assoc 10 Ldata))
Lend (cdr (assoc 11 Ldata))
StartCloser ; T/nil
(<
(distance Lstart (setq LsC (vlax-curve-getClosestPointTo RL Lstart T)))
(distance Lend (setq LeC (vlax-curve-getClosestPointTo RL Lend T)))
); < & StartCloser
); setq
(command "_.change" L "" "_non" (if StartCloser LeC LsC))
); repeat
(setvar 'orthomode orth); reset
); progn [then]
(prompt "\nNo unlocked Lines selected to make perpendicular to reference Line."); else
); if
); progn [then]
(prompt "\nNo reference Line selectede."); else
); if
(prin1)
); defun
It turns the left side here into the right side:

As you can see, it does not extend the reference Line if a changed Line ends up off the end [awaiting your reply to my earlier question], but it could be expanded to include that. It works with Line entities only, but could be made to work with Polylines with certain limitations.
[It uses the CHANGE command that a lot of people today are unfamiliar with, probably because there's no icon for it in the ribbon. Old-enough farts like me know it from way back, and it's still in there, at least into Acad2020 that I have here -- I'll test in 2025 later. When applied to a Line, it takes the end closer to the given point to that point, but ORTHO affects the result, which is why this turns that off. But it avoids the need to manipulate entity data or mess with options like (setpropertyvalue) or VLA objects, though those are other valid approaches.]
Kent Cooper, AIA