Whedon managed to sidestep Thanos again for Avengers: Age of Ultron, as Ultron (duh) was that movie’s main antagonist and the mid-credits scene showed Thanos retrieving his Infinity Gauntlet so he could get the job of collecting the Infinity Stones done himself.
Like most Marvel Comics fans, Joss Whedon was familiar with Thanos, but just because you know about a character doesn’t mean you necessarily understand their deeper characterization.
Whedon was clearly aware that Thanos is a big deal in the Marvel mythology, but similar to his time on the Batgirl movie, he just couldn’t figure out how to crack the code.
So when Whedon was working on The Avengers, he made the decision to have the Mad Titan cameo at the end, but he didn’t have a specific plan in mind for him at the time.