That number seems absurdly low. Kings typically have wealth such that they can regularly raise armies and throw them around. If a peasant makes a gross 500 GP a year, that means this guy can afford an army of... 40 peasants. Not a single knight, or spellcaster in the bunch. If you say he only needs to meet the peasant's net profit of 140 GP, he still can only pay 140 or so troops, total. And that's if he's not also doing things like building or maintaining castles, feeding those 140 peasant guards, paying other servants, and so on.
I suggest that a king's coffers are going to be much, much deeper than 20,000 GP/yr. I think you're off by at least two orders of magnitude, here.
Looking back over things, it probably would have been better to presume that the costs of buying magic swords for the army would have been part of the outgoing expenditures drawing off of the gross revenue, rather than being something to spend the kingdom's net profits on. However, that wouldn't necessarily change the bottom line all that much, in terms of how feasible it was to buy magic swords for the army.
Consider that much of the costs those peasants pay is taxes or rents to lords. The costs of food for peasants is on the order of a silver a day, about 3 GP per month. Let's say another 7 GP goes into tools, seed, and maintenance. That leaves 20 GP going into taxes and such. Thus, for every thousand working peasants in the kingdom, the king is getting 20,000 GP per *month*, not per year.
The only presumption I made was that, for commoners, 30 gp per month goes to the costs of living. You can shift the ratio of how much of that are taxes versus the costs of buying things like food, housing, healthcare, and necessity items to any ratio you want. However, let's stick with the idea that the peasantry pays 20 gp per month in taxes.
Now, you were stipulating the king at 20,000 a year net profit. So, in a tiny kingdom of, say, 10,000 people, where is the other 2,380,000 GP going? Well, into the king's budgets - for armies, and servants, and equipment, and so on. Would not magic items be working into those budgets, rather than out of the King's personal profits? He has *millions* to work with, not tens of thousands.
Let's leave aside for a moment the issue of having a standing army at all times versus pressing the citizenry into armed service in times of need; so we'll assume an army of 10,000 and a civilian population of 10,000.
Insofar as the civilians are concerned, the actual tax-paying population is far below the total population, simply because some are going to be children and the elderly. Let's conservatively estimate that only 20% of the people fall into these extremes. We also won't presume that there's any tax burden on the soldiers (technically their taxes are simply being pre-emptively deducted from their pay, but the end result is the same).
So, eight thousand people paying 240 gp per year, gives the kingdom a gross income of 1,920,000 gp. We'll subtract the 20,000 gp net profits to give us an even 1.9 million gold pieces.
The problem is that this money has to be put back into the whole of the kingdom, not just the military. If we go with your presumption that the soldiers only earn as much as peasants, at 140 gp per soldier per year, for ten thousand soldiers that's still 1.4 million gp. So now there's only 500,000 gp left.
That money has to go to everything else. Let's presume that the kingdom's infrastructure, foreign relations, and other expenses take up half of that remainder. Now there's only 250,000 gp remaining for the military.
Most of that is going to go towards the logistical costs of having a standing army - remember, we haven't spent
anything else but the soldiers'
net profit. So we'll presume that the military still has to buy their equipment, food, housing, medical care, training, and other needs. That's apart from buying military equipment such as siege engines, building forts and encampments, and related expenses. Given the large variety of things we've listed here, 200,000 gp seems reasonable.
Now we're down to 50,000 gp for other things. Admittedly, this is more than 20,000 gp, but not that much more. Presuming all of this was spent on
+1 longswords, it would still take
almost five hundred years to equip the entire army...which is a very long time. Enough so to say that it's not worth the degree of investment for each soldier getting an extra +1 to damage (over the cost of non-magical masterwork longswords).
Of course, these numbers can be massaged all kinds of ways by manipulating many of the assumptions that we were making for where most of the rest of the money went (as well as with things like the non-taxed population, the cost for peasants to live, etc.), but that's sort of the point - when you can manipulate the details of the economy to that degree, since the rulebook doesn't go into that level of detail, you can plausibly make them turn out whatever numbers you want.