Laziness is okay in my book, as it makes you want to look for easier solutions!
This script sounds like it does what you want. Your initial idea is good, but you cannot (or hardly) use the clipboard inside a javascript. So the script scans for your GREP match string (that was a good one!), and when it finds a paragraph with it, it kicks into action: it stores the found stuff in “lastMatch”, so it can compare the next paragraphs against this same value. If it's the same, the paragraph is skipped, and if the pattern *is* found but not the same, your style (I called it “LineAbove”) is applied. Then this value is used as “lastMatch”, and the loop goes around and around until the end of your text is reached.
As it is, the LineAbove style is *only* applied when the previous and current paragraphs contain the GREP string, so it will never (I think!) be applied at the very top or very bottom of a table. Note: blank lines also 'break' this pattern, and you might or might not have had that in mind.
Place your cursor in the first row to check, double-click the script, and stand well back.
(Oh — sorry, David, this forum's editor can't handle medium-long scripts! No prob. — RY, download it from my site: https://www.jongware.com/binari…..er.jsx.zip — unpack, put into your scripts folder, run as above.)
(Be sure to first change the style name somewhere near the top to yours, though.)