Pages don't have children, bookmarks do. bookmarks and pages are separate, they do not own each other.
Read ad your code carefully. If there are no bookmarks if deletes all pages with no Annots. If there are bookmarks (if the bookmark root has children) nothing is deleted. I dont quite understand what you want but I think you are looking for something that is not only not automatic, but nonexistent.
Ok, I'll try to better explain what I am trying to do. I have large PDF files of 3000-4000 pages (product assembly information). All pages are bookmarked. All pages have named destinations that were created from the bookmarks. Bookmarks are arranged/named by major group (7 digit number) and subgroup (page 2, page 3 etc.) There are links on a web page that point to each major group destination.
I use this script, combined with the 'Find and Highlight' action, to find, highlight pertinent model numbers and delete pages that are not annotated. What I'm trying to do is KEEP ALL pages that are destinations for a major group(even though some may get annotated). Since you say that there is no correlation between bookmarks and pages, is there a way I could get the information that is presented in the destinations panel (destinations sorted by name and corresponding page number) so that I could remove those pages from the pageArray if they exist? or even prevent them from being pushed to the array?
The only way you can get the page numbers to which the bookmarks are pointing is to execute the bookmarks (using the execute method of the Bookmark object -- forget about annotations, they are not related), and then check the current page number (using the pageNum property of the Doc object).
There's no way to get a list of Named Destinations or where they are placed using JS.