This seems a very convoluted path. Why not get the location of each word in the PDF and see if any words sit outside the box?
TSN's approach can actually be done in JavaScript - as long as you know the location and size of the green box. The trick is to figure out of any part of a word is outside of that green box.
Take a look at the "word finder": Acrobat DC SDK Documentation - Doc.getPageNthWordQuads() The documentation for Doc.getPageNthWord() has a reference to an example ("Example 2") that demonstrates how to iterate over all words.
What you want to do with overlaying page content is not easily possible in Acrobat. Two potential solutions were already mentioned (layers, which would require you to split the document into individual pages and then import them as payers), and watermarks (which would require you to apply every page in your document as a watermark). This approach does have limitations however: When a page has a white background, it will obscure everything else that was placed on the "page layer stack" so far, and you will not be able to see what was put on that stack before.
If you really want to use this overlay approach. I actually have a tool that I wrote for myself while analyzing customer files a while ago that takes every page of a document and creates such a composite page. It's a Java program that would require you to have Java installed (this is different from JavaScript). You can download it from here: MergePages.jar
There is no warranty associated with that download, it works well for the kind of file it was designed for, but it may not work for you. If you choose to download the file, you are doing this at your own risk.
If you do download it, you would run it from the command line as follows:
java -jar MergePages.jar input.pdf output.pdf