In Season 4, Episode 13 of The Walking Dead, there was a scene at the very end where Daryl and Glenn step out of a car. Daryl and Glenn haven't seen each other all season. Was that some kind of dream sequence, or was it foreshadowing? And if it was foreshadowing, it was actually set in the future which kind of screws up the timeline a little, as the episodes would be out of order. I'm thoroughly confused...
I believe you're referring to S04E13: Alone, though Daryl and Glenn encounter Bob Stookey at the beginning of the episode, not the end.
This was a flashback to when they first met Bob who had been surviving alone for a while.
The episode began with a flashback montage of Bob on his own walking through the woods and looking defeated. He runs into Daryl and Glenn, who give him the Rick-approved line of questioning about his apocalypse life.
Origin story! Sort of. The start of one, anyway. Bob even gets a cool song as he’s wandering slowly through the forest.
He hears Daryl's chopper coming down the road to the rescue. So this is right as Daryl finds him, about a week before the start of Season 4. Can you imagine Daryl literally riding in to rescue you? It’s Daryl and Glenn who come by him.
Thematically, this was to bookend our characters being "Alone". We begin by meeting Bob when he is wandering alone, and we close with Daryl finding himself alone after Beth is kidnapped.
I think I figured it out; remember in season 3 when we first meet bob. Sasha said to Bob "Bob we don't know if you're a team player or not? Then she said "Daryl found you al alone. Maybe Glenn went with him, and it was a scene from past when Daryl finds bob before the rest of us met him in season 3.