This is only tangentially related, but it reminds me of a bad and overcomplicated theory I came up with at the end of Age of Ultron to explain its odd post-credits scene, where Thanos says "fine, I'll do it myself," as if he somehow expected the events of the movie to result in him gaining one or more Infinity Stones. Why would he think that?
*Broadway musical cue* Well~ I'll tell you~
So we know that Thanos gave Loki the scepter containing the Mind Stone, presumably with the thinking that Loki wouldn't realize what he had, and would just hand it back once Earth was conquered. We also know that the scepter housed an advanced and malevolent AI which ended up becoming part (probably most) of Ultron. My idea is that the AI represented Thanos' Plan B in case Loki failed and the scepter fell into human hands. Humans (i.e. Tony) would discover the AI, attempt to harness it and fail, allowing it to upload itself into a body and gain agency, which is what happened. Ultron would believe he's a free agent and do as he pleases, which can reasonably be predicted to mean killing the Avengers. Once he's won, a backdoor program unbeknownst to him would activate, overriding his free will, and he would rendezvous with Thanos to hand over the Mind Stone (and any other Stones he might have discovered while laying waste to Earth), easy as you please.
Don't like that? Here's my other theory: AoU's post-credits scene actually takes place much further in the future, right before the start of Infinity War. The Black Order are down on Xandar trying to retrieve the Power Stone but are having difficulty, so Thanos steps in. "Fine, I'll do it myself." This one probably works better, as it doesn't involve Thanos putting on the Infinity Gauntlet and then... doing nothing for another three years.
Of course, the real answer is that Joss Whedon threw Thanos in at the end of The Avengers as a tease but then had no idea what to actually do with him, so he's just spinning his wheels narratively in AoU. But that's no fun!