I'm sorry but I do not know enough Lisp to even follow your code
Conceptually, I have some thoughts but I do not understand your process enough to be able to offer any meaningful guidance or a solution.
If I understand you correctly now you are seeking to take a designed centerline and by "designed centerline" I mean one generated with tangent segments and tangent curves which may or may not have polynomial spiral transitions.
And you wish to obtain a profile along this alignment from a tin.
The problem that I see is that you cannot maintain a true 3-D polyline with segments and still represent the elevation of every intersecting tin triangle edge. You could however intropolate every point of interest to an elevation on the tin but I doubt this is the solution you are after.
To the best of my understanding the only way to truly represent this is to decompose your horizontal alignments down to segments defined by the location of intersecting tin edges which then presents a few problems in that horizontal points of interest, i.e. what I would refer to as PC,PT, TS,SC,CS,ST will most likely not fall on a triangle edge and these points will have to be intropolated between the previous and next vertex or you will have to solve elevation of the point within the triangle that it resides
It is an interesting challenge