Let me just clarify the wanted behavior.
You need a Cage driven by the spline with a certain depth. Then you want to place the separation bars on the markers points and control open spaces by MatID 1 or 2.
Am I got it right so far? Not sure how you are attempting to place Gude Splines but I assume it will be an issue if splines are oriented differently. I see you are working in the free mode so I guess you are just generating the Cage and then you are transferring it to mesh.
As for your MatId problem, I would go with a simple Selector and YplineMatId.