It just happens, or rather you give him the order to cast X and he'll burn however many gems he can/wants to cast X. No delay, no special script. Since the path increase only lasts one turn, it would be pretty silly to have it use a full action

If the mage cannot reach a state in which he can cast X (e.g. doesn't have enough gems, or you thought the gem used to increase the path gave him one more gem "slot" when it doesn't) then he'll go off script and cast whichever spell strikes his fancy.
Note that mages also tend to burn gems to reduce the fatigue cost of spells, sometimes in stupid or unnecessary ways so if the boosted spell you want to cast has to happen late in the script for some reason you probably want to give that mage an excess of gems just in case. Better safe than sorry.