Too bad it only works with lines, but it will draw the line anywhere and doesn't have to terminate at the reference line.
It might be worth noting that vlax-curve-getFirstDeriv will return the direction of any object at any given point. If the object is a curved one, the first derivative is the direction of the tangent at that point. This works with any entity, including splines.
The only place you need to be careful is at the vertex of polylines (angle points). The first derivative at polyline vertices is the tangent direction of the segment that is departing from the vertex, e.g. the first derivative at parameter 4.0000 is the tangent direction of the segment between params 4 and 5.
So if you get the first derivative, then rotate it 90°, you will have the perpendicular bearing.