Technically - yes - it is possible. However, the real weakness is that there are no metrics or functions that can easily, or more importantly, performance-wise, address that kind of scenario. The AI, unlike the human, has little to no ability to 'remember' what he saw, even just seconds ago. This makes pro-active behaviors difficult to construct.
Eco management is another weak area, and one the AI has some difficulty adjusting to - part of the problem is one of scale, another is the game design itself. Due to the random nature of the unit designs, there is little commonality in building costs and times - as a result, a constructor's consumption can bounce erratically from item to item, a condition which afflicts factory builds as well. Many attempts have been made to have the AI 'pause' his construction, which is unfortunately a band-aid on the problem - the real problem being one of reasonably accurate prediction of consumption. The side effect of the original code designed to 'pause' building is a ping-pong of rather costly events which don't solve the economy issue, but tend to push it around, and at some considerable cost to the performance.
There have been many potential AI developers over the years that have had the best of intentions, only to throw their hands up at the inability to address that flaw.