You just need to edit the name property of the Bookmark object.
For example, this code will change the name of the first bookmark:
this.bookmarkRoot.children.name = "New name";
So my Javasript would look something like this - I know it is incorrect. Then I change the variable number to the page number where I want to start numbering the Bookmarks?
var root = this.bookmarkRoot;
for (var i = 0; i < this.numPages; i++)
this.bookmarkRoot.children.name("Page " + (i+1), "this.pageNum=" + i, i);
app.alert("Processing error: "+e)
No, this code has a lot of errors in it. You should follow the example I provided, which is only used to change the name of the bookmark, not the action associated with it or anything else. You should also read carefully the Acrobat JS API Reference relating to the Bookmark object.