Hi,
Handling these in separate generators would be the recommendable way in this case – the top of the frame is easy, Alignment Z > Top | Deform mode Vertical. The bottom frame can be Alignment Z > Bottom | Z translation wired to the -XsplinePosition.z expression | Deform mode Stepped. If needed, you can add some horizontal divisions by driving the Pivot Offset value with the same expression. Please find attached a sample scene (230601_YPivotOffsetSampleScene_iToo.max) showing this possible approach.
I hope that helps.
Best regards,