Welcome to the forums @bjr29!
Off the top of my head, you'll probably need to make a new Line2D when you detect a split. Then have one line2D go from the beginning of the original line to the split, and have the other line go from the split to the end of the original line. I'm am fairly sure there is no way to split a Line2D in the Line2D itself though, unfortunately.
For splitting the line every X units, it should be more or less the same thing. Detect if a line is too long, and if it is, create a new Line2D node. Make the original Line2D node start from the beginning of the original Line2D to the maximum distance a line can be (specified by X), and then place the new Line2D at the maximum distance (where the first line stopped) to the end of the original line.
That is how I would try to achieve it. I have not tried to make such a system myself though, so there may be other, better ways to handle it.