Sam wanted the world to end. It would have saved him from having to choose
between the quest and Frodo. So he opened his eyes and is forced to face
reality once again.
I think the beginning of Sam's full transformation was after looking in the
mirror of Galadriel. His choice to stay rather than run home to save his Shire
was the turning point.
Next I think that it is neither. I always felt that Sam was comming to grips
with the facts by taking Sting, the Phial etc. It is as though he is getting
closure through the act of taking his Master's affects.
I think he talks aloud simply because he is scared. Everyone wants someone to
talk to in high stress moments. Part of Sam's mind just hasn't realized that
he's talking to a corpse (so he
thinks)
Do not meddle in the affairs of Dragons, for you are crispy, and taste good with ketchup.