I commented on this a little on the Frodo Hero thread, but I'll elaborate here. While the "bad" made him attack Gollum for the ring, look at what happened to both combatants. Frodo held to the ledge, Gollum did not. Gollum held to the ring, and it destroyed him. Frodo, at the absolute last possilbe second imaginable, finally let it go. It took long enough, I know, but he had to finally let it go, or be destroyed.
And then, with the ring gone, hell all around him, he had a choice to make, let go and die, or try for a just a little longer. Sam made the choice obvious, with him yelling to hang on. And he did. Instantly with the ring gone, he held on still. The ring couldn't force him to try more like it did before (example: his burst of strength after an attack from Gollum). The decision to live at that point was all Frodo.
And when he thought he would surely die in the eruption of Mount Doom, he was still content. His life history, memories of the Shire, green grass, and etc were all back. His life was no longer open to the lidless eye of fire. He was free, and if he had to die, he would.
Frodo still chose to die (although he didn't), but he chose to die on his terms, not the ring's.
So in the end, I liked Jackson's treatment of the moment, and I felt that is was appropriate with the source material and the actions of desires of the different forces in that scene.