I think it would have been natural for at least some of the writers to have started considering the implications when it was decided to keep Cas instead of Anna.
Anna and Dean were supposed to be a romance. If Cas picked up Anna's role in the story, it makes sense at that some of that romance would carry over into Cas' storyline. And the righteous angel who sees the goodness in Dean and defies Heaven to fight by his side is a very romantic story.
It makes sense for the writers to think it might be fun to play with this a little, to lean into the bond Cas had with Dean. To maybe even want the question to float around in a viewer's mind when they're watching.
So I'd pick 4x10 Heaven and Hell for the point where it started. Dean kisses Anna, the camera moves to focus on Castiel's reaction. The simplest explanation for this is (and always has been) Castiel is uncomfortable because he's developing feelings for Dean.
But it's left ambiguous and never explained or addressed again. It's a shot designed to put questions in your mind, for fans to debate about. There's a multitude of potential meanings, that one of them is "it's exactly what it looks like" had to be something they understood when they made the episode.
This is also the episode where Castiel appears to have been demoted because of his feelings for Dean. Or at the very least reprimanded and ordered to distance himself. "You see, he has this weakness. He likes you."
It's been a while since I've seen season 4 so I could be wrong, but this episode always struck me as heavier on the subtext than prior ones. Where it really does feel designed to suggest there could be something more, as opposed to the characters just bonding and having tension.