A few things,
1) previously.tv's editor for posting is horribly confusing.
2) The episode took place inside the confession dial (puzzlebox) and as such was a self contained system.
3) Time in the puzzlebox could pass without relation to what reality was doing.
4) There were two seperate time threads. For the puzzlebox, time passed linearly for billions of years. For *each* iteration of The Doctor, each time he stepped out of the teleport chamber, only a split second had passed since he was teleported into the puzzlebox. So for the doctor, Each iteration only lived for a day or two. And for the final iteration, Only a day or two had passed (to him) since Clara died, and he was teleported into the puzlebox.
5) Of interest, because the confession dial is The Doctor's *and* is Time Lord technology, all bets are off for how it works. For example, each room reset, which means that the clothing that was on the chair would also have reset. So it's very reasonable to think that the first doctor through wouldn't have to have walked around naked. Same thing with the phrase 'bird' in the dust/dirt. The wall was the gateway, so it wouldn't reset.
6) But, The Doctor would know he's been trapped in the puzzlebox for billions of years, So, The Doctor saw Clara die a day or two ago, and also realizes that he has died literally billions of times inside this puzzlebox, even if he can't remember all the deaths. He's going to be a hot mess trying to come to terms with that.
7) I Just don't understand people who hate a show so much, and keep watching it, just to post about how much they hated it.
8) I think the episode was intense, very well thought out and planned, and my only quibble with it was the musical score overwhelmed the dialogue at times and made it difficult to hear what Capaldi was saying.