Plot hole: The Doctor leaves Martha a recording with instructions for her for when he's human. However, the flashbacks to the incident that led to him using the Chameleon Arch don't leave enough - or any - time for him to have made the recording, presenting his decision to use the device as a spur-of-the-moment one that he immediately acts upon.

Doctor Who (2005)
1 plot hole in Human Nature (1) - chronological order
Doctor: So, that's the trap. Or the test or the final judgment, I don't know. But if I kill you, I kill her. Except that implies, in this big grand scheme of Gods and Devils, that she's just a victim. But I've seen a lot of this universe. I've seen fake gods and bad gods and demi-gods and would-be gods - out of all that - out of that whole pantheon - if I believe in one thing... Just one thing... I believe in her.
Last of the Time Lords (3) - S3-E13
Question: Why does The Master fear The Doctor forgiving him? What's he forgiving The Master for exactly?
Chosen answer: The Master knows that deep down, he deserves death for the crimes that he's committed throughout his life, and since he regards The Doctor as his arch-foe, he expects it to be at his hands. The fact that The Doctor is still willing to forgive him after everything the Master's put him through hurts him more deeply than death would.






Suggested correction: He would have been planning the change to human for a while now, not just made it up on the fly. So he could have made a recording before the opening scene.
The episode makes it pretty clear that he and Martha got taken by surprise by the Family's attack. The Doctor also explicitly says, when he gets out the Chameleon Arch headset, that he never thought he'd use it. The flashbacks consistently present his decision to become human as one made as an urgent, in the moment one.