Testing Results
The code works, and what's more, it does affect air units, but not wholly. When I got rid of the oil supply all modern naval units were immobilized, from the transport to the battleship. All land units that are mechanized - tanks, artillery (mobile and regular) and whatnot - also could not move. Funny thing though, mechanized infantry apparently is not classified as mechanized in the game, because it could still move! So could gunships and mobile SAMs.
Now to the air units: no plane could conduct an aggressive action without oil, nor could they rebase to another city. They were basically frozen where they were. They
could undertake recon missions, however, and fighters could still execute their air superiority missions even without oil. Finally, even airships, cruise missiles and tactical nukes could not move.
So it is a very good partial solution. The main thing that bothers me is that air units can still perform interception missions, which we'll have to change. Ironclads were also affected by the oil shortage, despite the fact that they are coal-fired.

(I suppose this is irrelevant for those of you who want this for WW2 scenarios, though.)
In summary, the game basically does what it is supposed to, and with a little tweaking in XML for units like the mech infantry and gunship, I'm sure we could get those issues fixed. However, the air missions still need to be addressed, probably by forcing them to skip their turns until fuel supplies are restored.
EDIT: One other thing: I said that tactical nukes could not move when you have no oil (i.e. relocate to another city), but they
are still able to nuke the enemy. This is good, because ICBMs and nukes would not be affected by an oil shortage, since they presumably have their own supplies stored with them for a one-way mission.