I tracked the issue, pretty much what @mhupp stated, it just does it different depending on selection 1 and selection 2.
I think at least part of that issue was using vlax-curve-getPointAtDist and/or vlax-curve-getClosestPointTo changes according to the first selection. Normally good enough for most people.
I made headway trying to get the LISP working similar to your manual method, it's fairly good, the main issue is on some polylines, even with your method an actual decision on what is the best line(s) at certain spots is needed. The new LISP I worked on, seems to be pretty good no matter the selection order on all but the long rectangle shape. Working or not, I might go ahead and post what I have Monday when I return to work.
I worked out manually why selection order on the one with the straight through the corner and reverse selection there is a little dogleg shape, there is a decision to be made there, I did it both ways and matched mine and Lee Mac's shape.
It will be Monday when I get back to work before I have time to keep testing.
I wish I had found Lee Mac's code, somehow I missed that one. I would have never made mine, for some reason those rolling ball LISPs never worked out very well for me.