The field code would be:
{IF {PAGE} = {NUMPAGES} "End of Document"}
where all the field braces (i.e. { }) are created in pairs via Ctrl-F9.

Do note that, if you have your page numbering starting at other than 1 on the first page and/or you have any changes in the page numbering sequence in the document, the PAGES & NUMPAGES fields might not give the exact value you need to test - you may need to add or subtract the difference from either side of the equation. For example, if, on the last page {PAGE} returns 120 but {NUMPAGES} returns 130, you would need:
{IF {={PAGE}+10} = {NUMPAGES} "End of Document"}
or:
{IF {PAGE} = {={NUMPAGES}-10} "End of Document"}

The mistake I did was try to type in the braces '{}' through the formula wizard. The system would not 'see' them as code.

To fix:
Delete out old/bad formula.
I opened up field by typing in cntl +F9 then enter in 'PAGE'. --- {PAGE}
THen I put the cursor next to that and did it again for NUMPAGES. ---{Page}{NUMPAGES}
THen highlighted both then hit CNTL+F9 which put the braces on the ends of both fields--- { {Page}{NUMPAGES}}.
Then typed in 'IF', '=', "End of Document' in appropriate spots. --- {IF{PAGE}={NUMPAGES} "End of Document"}
Toggled field codes to hide formula. And presto, zingo...it worked.

PS. Do not copy the formula either. It will not work. It has to be typed in with the use of the CNTL+F9. --- Again, thanks paul.