From my understanding of this sentence:
How to make always left point as pt and right point as p2 even I picked from right to left?
IMO: It means the OP wants to "sort" the returned points such that p1 contains the left-most point picked, and p2 the right-most - no matter in which order the user picked those points. Also that seems to be what HasanCAD's done in his code. Perhaps we just understand it differently.
As for CAB's idea of using angle to figure out which point is left and which is right, does that work if AngDir or AngBase is set different from the defaults? If I test this it goes a bit wonky, especially if there's also a UCS to worry about. BTW, if there's a UCS then getpoint gives the UCS values - not the Screen's or the WCS's, so in this case if the UCS is turned 90deg CCW from the screen display then you effectively get the lower point in p1 (as displayed on screen).
HasanCAD: When you mention left/right, do you refer to as seen on the screen, or as per the current UCS, or as per WCS, or should AngDir/AngBase also be accounted for? By default they all mean the same thing, but some setting changes could throw that idea out the window. At the moment the comparison of X values takes note of the UCS, and the angle takes UCS+AngBase.