When I first saw NotD, I had assumed that the Doctor being lost in his own timestream was going to be the catalyst for the 50th anniversary episode. It made sense as how he'd end up interacting with his past incarnations and provided an opportunity to possibly travel across the Doctor's entire life (which made sense for a big anniversary episode). Consequently, I just assumed the episode ended with the Doc and Clara still stuck in the timestream.
D0tD said otherwise though and it seemed the Doc and Clara were long-gone from the timestream, like it wasn't even something we should be considering. It seemed odd and I - like a lot of people - wondered how the heck they'd got out. But then I went back and watched NotD and some details stood out this time. When Clara is following Matt's voice and finally sees him, you see a big flashy portal close behind Matt. This was obviously representative of a "doorway," he had used to enter his timestream. Then, before they reveal John Hurt's face at trhe end, we see Matt carry Jenna off in the same direction he'd originally come from.
Knowing now that the timestream wasn't relevant to the 50th, I think it becomes a lot clearer that the Doctor simply walked in, guided Clara to the right place by calling to her and then just walked straight back out the timestream.
Not that clear on first viewing, but fairly obvious on a re-watch.