I then turned to Stack Overflow. Sometimes, just the act of trying to write a question as clear as possible will cause me to think of the answer before I even post the question, but not this time though. I went ahead and posted this question.
After I posted I got to thinking that maybe it wasn't my logic, but just that the code was being ignored. I created a alert message using view.postScript and it still did not work. I then tried putting that alert in the afterRenderResponse event of the xpage, where I had some other code. Nothing happened there either. Frustrated, I then started putting the code in all the events, and to my surprise it worked some places and not others.
Basically, the view.postScript() method only works in certain events. I do not know why this is, but if I had to guess it has something to do with the JSF lifecycle.
I did some experimenting with the Xpage events and here is what I found.
I can tell you that it doesn't work in the only Panel event, onClientLoad. I am pretty sure I have used it with onClick events before, so it does work there.