Chuck isn't one to look for subtext. He really isn't. So when he gets the sneaking suspicion that Castiel and Dean are fuck buddies, he tells himself it's rather obvious. The lingering looks they give each other, the mark Castiel left on Dean's body(that has to be hard to explain to any girls Dean picks up). But then he realizes that the looks Castiel gives Dean are ones of longing and something else, something hidden, and he realizes that Dean is totally oblivious like he usually is.
But Chuck also remembers when Dean stumbled upon Jimmy in the rubble and was worried that Castiel was hurt; he remembers that Dean asked for Castiel even after he knew it was Jimmy. He recalls Dean's praying and Castiel showing up, always showing up and he knows that Castiel's "time away" was a punishment was because the pair were getting too close.
Chuck knows the world's ending when Castiel and Dean show up even though he knows Zachariah sealed Dean away; he knows Castiel helped Dean escape even after the punishments and the warnings(and only the bastard in heaven knew what else). And the look Dean sends Castiel when the angel says they're making it up as they go wasn't even trying to be subtle; it was made of pure gratitude and love and thank you that Chuck just knows.
So when the archangels arrive, it's no surprise that Castiel decides to sacrifice himself. Chuck watches them send each other one last look and sees the total love in their eyes before Castiel whammies Dean away.
Chuck knows there's only a slim chance they'll make it out of this alive and Dean and Castiel might never get Happily Ever After(and Chuck might never get to write it) so he puts a hand on Castiel's shoulder(saying I'm so sorry even if he doesn't), but Castiel's look tells him not to bother(tells him that Castiel, Dean's Cas, may be afraid, but he'll always have faith in Dean).
And that's how Chuck knows that Dean and Castiel might not have been lovers, but they were in love and that's why Chuck isn't afraid(because love always seems to win out in the end).
