How are you using this function?
Sometimes you can get into trouble because osnaps are being applied more often than you intend. For example, you might expect the following code to draw a line between your midpoint and another point, but it might not:
(setq ptA (btwn))
(setq ptB (getpoint "\nEnter another point"))
(command "_.line" ptA ptB "")
The problem is that osnaps are still turned on when the line command is issued. For example, if ptA (the midpoint) happens to be near some other line, and the endpoint osnap is on, the new line will be drawn between the endpoint of that existing line and ptB, not between ptA and ptB.
Is this what's going on?