I think maybe that when you
(setq c (getvar "lastpoint"))
you are retrieving the point at the end of your line command, which by your design is 200 units from its first point, p.
That being the case, why do you need to ask for the distance; it's 200, right?
The only other thing for which you need to watch out is running object snaps picking up a point on some other nearby object. I think @ВeekeeCZ demonstrated the use of "_non" which is a good habit. That or turning off OSMODE.
There is no difference in the results of the DIST command vs. the distance function, except that both are real numbers that may display differently. due to luprec. Observe...
Command: (setq p1 (getpoint) p2 (getpoint p1))
(733.461 140.416 0.0)
Command: dist
Specify first point: !p1
(643.982 71.4946 0.0)
Specify second point: !p2
(733.461 140.416 0.0)
Distance = 112.94477, Angle in XY Plane = 38d, Angle from XY Plane = 0d
Delta X = 89.47868, Delta Y = 68.92088, Delta Z = 0.00000
;; BTW, my LUPREC was 5.
Command: (distance p1 p2) 112.945
Command: (rtos (distance p1 p2) 2 5)
"112.94477"
You can see that the distance function returned a value to the screen to only 3 places. That's sort of an AutoCAD habit. But if you use the function to store the distance in a symbol, then it's probably good to 16 places, which is a lot more than you need to build just about anything.