I think they initially planned to show something else altogether, maybe Dev seeking solace in Sanju with him and Sonakshi being in a rough patch, but then the audience reaction was so bad that they just kept this one side "love" concept going for 20+ episodes
This I agree. I believe they wanted to show something else. That he was seeking comfort, as a friend, in Sanjana while his marriage goes through a rough patch. I knew they would never show him straying, it's totally opposite to his character. But the audience reaction has been so bad, that they had to go this way.
I think the same happened with Ayush also. I think they weren't planning on showing him as Devakshi's child, and that it was some scam, that is why Sona wasn't connecting with him, but audience liked the kid himself and they hastened to wrap up the track and ended up making him the biological kid.