You can't style backwards, no.
What you can do is this:
- Create "line number," "body text space before," and "body text no space before" styles.
- Set up "line number" so that the next para is automatically "body
text no space before."
- Set up "body text no space before" so that the next para is
automatically "body text space before."
Now, this part is a bit tricky, but it does work.
- Select your Line Number paragraph and all the text up to the next
line number, but do not include it.
- Right-click or control-click on the "line number" style in the
Paragraph palette. This gives you a contextual or "fly-out" menu.
- You will see at the bottom "Apply Line Number and then next style."
- This will make the first paragraph Line Number, the second paragraph
"body text no space before," and all the rest "body text space
You can only select up to the next line number, because if you select all your text, the last style in your cascade (body text space before) has the rule "next paragraph style is the same."
If each section has only three paragraphs (line, no space, space), then you could set "body text space before" to have "line number" as the "next paragraph style," and the whole thing will auto-format.