Code:
(setq PT2 (osnap PT1 "endp,mid"))
I'm assuming the PT1 variable is the actual user pick, correct? If this is true then I think the code in red is the problem. The osnap function takes a supplied point and "snaps" to another point on an object based on the supplied osnap settings ("endp,mid"). So basically, the code in red is taking the supplied point (PT1, whether it was selected using the (3) setting of osmode, or by a user over-ridden osmode setting) and then setting PT2 based on a "snap" to the "endp,mid" of the object passing through PT1.
I hope you can understand that!?!? To summarize it sounds like you would just like to use PT1 as your point. So you could either:
or just remove that line of code, and anywhere PT2 was used supply PT1 instead.
Ty