Have you tried to turn off Object Snaps before you run the script?
It looks to me as if your line is snapping to adjacent end of line points instead of plotting the listed coordinates.
I moved your thread to the The CUI, Hatches, Linetypes, Scripts & Macros Forum.
Your script is missing the blank line at the bottom, so it needed that for enter at the end.
Other than that, I ran it in AutoCAD 2000i on my home computer and they all look like your bottom image.