Hi,
When you say "... curve drawn in regular sketches. add (xyPlane) projects the z-coordinates of all points onto the plane ..." is not always true.
If you draw a point in a sketch like so:
skp = sketch.sketchPoints.add(adsk.core.Point3D.create(1,2,3))
you will get a point in the 3D space (z = 3cm).
Even though this point belong to the sketch, it is not in the same sketch's plane.
The same analogy can be make with any other curve in the sketch.
Think of the "3D" option you have in the sketch properties in the GUI. If you enable it, you can place any element in a 3D space.
You can look for parametric equations in the internet that help you draw the hourglass spiral.
Regards,
Jorge Jaramillo