We don't know.
This is a good question, but there is no satisfactory way to answer it given the limited information that we have in the books. Tolkien, for all his excellent worldbuilding, gave us very little insight into how the economies of Middle-earth work. Neither do we have much of a description of the lands of the Shire outside those immediately concerning our heroes. For example, the entry in the Tolkien Gateway website for the Northfarthing (roughly a quarter of the lands traditionally composing the Shire) tells us little more than that the air was fresh there, it was rocky, and that heavy snow was common in one part of the Northfarthing. See the entry here: http://tolkiengateway.net/wiki/Northfarthing
We also don't have any clear indication for what the value of goods was in the Shire because we don't see much buying and selling. We don't know what a hobbit would pay for a pair of brass candlesticks or what Pippin would have to pay to buy a bushel of apples or even what a small farm would cost. We do know that Frodo apparently thought it was believable that he could sell Bag End to the Sackville-Bagginses (probably for less than it was worth) and still have enough to live on and to buy a small house in Crickhollow but that's not really much to go on.
I would point out that one of the few discussions of trade dealings with hobbits is a conversation between Gandalf and Gimli's father Gloin about hobbits in Unfinished Tales.
'"What!' cried Glóin. 'One of those simpletons down in the Shire?
What use on earth, or under it, could he possibly be? Let him smell as
he may, he would never dare to come within smelling distance of the
nakedest dragonet new from the shell!'
'"Now, now!' I said, 'that is quite unfair. You do not know much about
the Shire-folk, Glóin. I suppose you think them simple, because they
are generous and do not haggle; and think them timid because you never
sell them any weapons. You are mistaken.
This hints at trade between the dwarves and the hobbits of the Shire. The line about hobbits being generous and not haggling suggests to me that perhaps hobbits tend to undervalue trade items in comparison to other races (or at the very least in comparison to dwarves). This could color Gandalf's perception that the mithril coat could buy the Shire. It suggests that you can buy more for less from hobbits than you might from a dwarf.
The hobbits themselves seem to place enough value on the coat to put it in a museum at one point (the Mathom-house at Michel Delving). However, even the word "mathom" connotes a certain degree of uselessness. This is the description of mathoms from Concerning Hobbits:
The Mathom-house it was called; for anything that Hobbits had no
immediate use for, but were unwilling to throw away, they called a
mathom. Their dwellings were apt to become rather crowded with
mathoms, and many of the presents that passed from hand to hand were
of that sort.
We are told that many of the weapons in the Shire were basically mathoms at the Museum. "Mathom" is one of the few uniquely hobbitish words that we get and I think the reason it survives in their language is likely because the other races of Middle-earth probably don't have a word that quite encapsulates the concept. To hobbits, a mathom is something that is supposedly valuable -- but actually not valuable at all because they can't use it. To put it another way, a dwarf might refer to many of the objects that hobbits call "mathoms" as "treasures" -- as the classification of the mithril coat itself as a mathom demonstrates.
This underlies an important point. Even if the coat is "worth more" than the Shire, that doesn't mean that you could literally buy the Shire with the coat. It's not like you could walk up to the Thain and say "hey, I'll trade you this mithril coat for the Shire and everything in it." Even if the Thain had that sort of power (he doesn't), then it's not likely that he would think this a good deal because hobbits don't attach that sort of value to mithril coats. You'd have to first trade the coat for lots and lots of gold or other goods and then start buying up individual farms. This might work well for awhile, but the hobbits are likely to get suspicious when they see that one person is buying up so much land in the Shire. Lotho Sackville-Baggins oppressed the Shire partly by buying up massive amounts of land and goods, but it didn't work out so great for him in the end.
As for whether Gandalf meant this statement literally --it is very possible that he did not, but I would point out that Frodo, at least, seems to take it somewhat literally.
Frodo said nothing, but he put his hand under his tunic and touched
the rings of his mail-shirt. He felt staggered to think that he had
been walking about with the price of the Shire under his jacket. Had
Bilbo known? He felt no doubt that Bilbo knew quite well. It was
indeed a kingly gift.
Finally, Gandalf, although he loves hobbits and is a big supporter of them, also sometimes makes some pretty condescending statements about them. Here's one example:
Ever since Bilbo left, I have been deeply concerned about you, and
about all these charming, absurd, helpless hobbits. It would be a
grievous blow to the world, if the Dark Power overcame the Shire; if
all your kind, jolly, stupid Bolgers, Hornblowers, Boffins,
Bracegirdles, and the rest, not to mention the ridiculous Bagginses,
became enslaved.
Another example is when Merry is telling Theoden about Tobold Hornblower and Gandalf interrupts with:
"You do not know your danger, Theoden," interrupted Gandalf. "These
hobbits will sit on the edge of ruin and discuss the pleasures of the
table, or the small doings of their fathers, grandfathers, and
great-grandfathers, and remoter cousins to the ninth degree, if you
encourage them with undue patience.
This is played for humor (and it is very humorous), but it's pretty rude and condescending of Gandalf when you think of it. Merry is an important person by Shire standards who is meeting the king of a foreign land for the first time -- a king who has literally never met hobbits before -- and Gandalf interrupts Merry to basically tell Theoden that hobbits are always boring people with their unimportant little histories.
Of course Gandalf also frequently extols the virtues of hobbits, but I think he likes the idea of hobbits as humble and sort of silly. His statement about the mitril jacket may be in this same vein. It may be meant to convey to the hobbits that Bilbo and now the other hobbits are now involved in Important Matters which make Shire doings seem small by comparison. Of course, I think the hobbits already know this, but it isn't beyond Gandalf to point it out.