I'd be assuming that it takes more than a few days to train a farmer up to even a level 1 cleric or wizard or druid or whatever. And even then, how many would actually be capable of learning? Willing to learn? There are bound to be more social issues lying around too... if solving the food problem is as easy as training more clerics/wizards/whatever, why were these 200k refugees farmers in the first place? Perhaps the god in question doesn't want to give everyone spellcasting abilities. What if the god in question CAN'T given everyone spellcasting abilities, and that sort of thing is limited? (Granted, I don't think that's an issue in the core rules, but we aren't talking about a hypothetical game, we're talking about a SPECIFIC game, and house rules can change a lot)
You'd need a whole third of the population to be a cleric to support a seige. For 500k people, that's 166k clerics. On SHORT NOTICE. No, I don't think that's going to fly. I don't think we can assume teaching the masses will work. There's got to be some reason why they aren't already clerics, afterall. By your assumption, no one would farm: every head of the household would pick up a level of cleric to feed himself, his wife, and a kid without ever having to do a lick of work more than praying. I -DON'T- think many DM's would make a society like this, and I esspecially don't think that THIS DM will. Because he set up a seige, you see. And so the DM, as DMs do, is going to make things INTERESTING. Or in other words, CHALLENGING.
I really think that we need to know what our resources are before we can start suggesting administrative plans. Obviously, the PCs, as adventurers, are going to need to break the seige and do so serious butt kicking, but while they're doing that, how are things going to manage back home... I know -my- group loves handling that sort of thing.
So!
City of Mages! How MANY mages? Average level? Max level?
How many clerics? Average level? Max level? What deity/deities?
How many mages are currently employed fending off direct assaults?
How many clerics are currently employed fending off direct assaults?
Any druids? Bards? Rangers? How many? Average level? Max level?
Also, what is the party composition?
Personally, I'd shy away from the really -easy- solutions, because they aren't as interesting and if your DM is anything like me or the DMs I've had, will be rejected anyway simply because the solutions are too easy.
With regards to new custom items, remember that it's assumed that you aren't just taking gold and turning that gold directly into an item, but that you're purchasing sundry items not listed in the book whose aggregate total is the gp value you see. In a seige, certain items may not be available, or not available in high enough quantities.