After a little more thought, I suspect that the simple approach is
likely to be the best, at least initially.
I'd suggest placing a condition (if new_public_lines_rdr.index() <
new_j) on the copying of new public lines to new private lines, then
finishing off with a loop copied from the 'insert' tag above -- (while
new_public_lines_rdr.index() < new_j ...).
I'm not in a position to get involved with direct editing of the code
within SourceForge, but I contribute these thoughts in the hope that
an active contributor may be able to make something of them.
Best regards, again
Nick