Nobody was thinking about what to do next after all that money filled the coffers of a political establishment not under any pressure to liberalize.
So, what am I missing here? How on Earth was this a good idea?
 - a polish one, https://www.goodreads.com/book/show/22310339-wiat-na-rozdro-....
On whose time horizon?
If yours is "the next five years", it probably looked pretty good for a solid thirty years or so.
The countries in question are authoritarian specifically because of the single dominant source of income (the oil exports). A specialized economy that relies on foreign sales is pretty easy to put under governmental control - and the arrangement is also convenient for the buyer. For non-authoritarian setup, you want diversified economy that's largely self-sufficient and trade-balanced; in such economy the government is mostly just an arbiter between roughly equal businesses and consumers.
>outsourcing manufacturing to China and them using the money to buy Western companies and real estate
The single biggest failure of the several recent US administrations: allowing the Chinese supply chain to become dominant; even "too big to fail". So big that there's a persistent narrative "we can't tariff chinese imports because it would hit the US consumers hard.". It is indeed similar to how the problem of oil imports used to be.
There's no fixing it other than slowly but surely shifting the bulk of imports away from China and towards multiple alternative sources. Once there are several major sources of import competing, putting a tariff or two on China won't move the prices all that much, thus making the tariffs a practical tool of trade negotiations again.
 big props up to both Obama and Trump for helping domestic US oil extraction expand & provide a counterbalance to the foreign exports
 India is a particularly good candidate for a major trading partner, with compatible culture, existing economic ties, and already growing industry