Posting like this is good for Customer Service but this is a Scripting Forum - do you agree?
I wrote a similar script which creates a bookmark on each page in the "main" text frame at the begining of the frame (the 1st insertion point). Here I attached the script and a couple of sample documents: before and after. It's more complex than what you want but you can use it as a starting point. In fact, you have to find a certain paragraph style, loop through every found item and insert a bookmark, say, at the beginning of the found text.
The dialog box