> For widows within paragraphs, the .ne must appear close > to the widow. If your input lines are not too long, this > can be accomplished by an ugly trick: insert .ne 2 before > every input line. If you want to get fancy the trick could > be automated with a self-renewing input-line trap.
Could that procedure not backfire, if the last line would still fit, but an .ne forces it to the next page? Here is a different trick, but it needs specific end-of-paragraph macros (which could probably be called automatically from all block-level macros) and it (ab)uses the line-numbering feature to count the lines of a paragraph, so no luck if you need line numbering as well: https://lists.gnu.org/archive/html/groff/2003-01/msg00024.html