Rock's current script starts with identifying the text frame of interest by using the selection. That's fine for testing concepts but it's not going to get you very far in a production script.

Your three-step approach assumes that the "last" frame on the page is lower down the page than the others, but it could be three side-by-side identical height frames.

Given that they're threaded, I'd use that to do this job. Presumably, the ultimate goal is to put the content of these paragraphs somewhere useful (such as a running head -- although you could use text variables for that).

Here's an approach: it assumes that none of the frames of the story are in groups or inline.

To make this script useful, you'd need to do something more intelligent with the values returned by getHeadTails. It might be smarter for that function to return paragraph references rather than the contents of the paragraphs.