(Except in the movie LOVE ACTUALLY, which showed a very bad behaving American president get exactly what he deserves from a plucky British Prime Minister, played by Hugh Grant.)
So you just 'assumed' all this?
I agree it is scripted, but I really don't think the President knew ahead of time what the Pope was going to say, nor visa versa.