An interesting question!
The first time I encountered the disparity in this saying—in a story by an author whose work I enjoyed reading—I was surprised, but counted it as just a typo. Anyone would, right? I know I sometimes mistype one for the other. But as I got further into the wide world of fandom and fanfic, I encountered this same “typo” often; too often, really, to consider it just a typo anymore.
The phrase appears to have originated in America, but the same controversy—think or thing—rages (for a dusty and somewhat pedantic definition of “rage”) on both sides of the Pond. Australia also uses this saying, so perhaps the saying is more likely to have been coined in England and traveled along when new lands were colonized.
However it began, the earliest known recorded use of the saying was in the Washington Post, April 29, 1897:
Another “Think” Coming to Them. From the Manchester Union: Methodist conference members throughout the country think that woman is all right in her place, but they are not of the opinion that that place is in the deliberative convention of the churches.
Another source of roughly the same era is the Chicago Daily Tribune, September 24, 1898:
Chicago thinks it needs a new charter. Chicago has got another think coming. It doesn’t need a new charter half as much as it needs some honest officials.—Quinoy Whig.
Both of these sources use think, not thing. In fact, the earliest use of thing in this saying isn’t until 1919, in the Syracuse Herald of August 12:
If you think the life of a movie star is all sunshine and flowers you’ve got another thing coming.
In addition, under the definition for thing, the OED states that to have another thing coming is a misapprehension of to have another think coming.
So to answer the question, the original phrase, based on sources currently available, is If you think X, you’ve got another think coming. Yes, it’s ungrammatical, but in all likelihood, it originated as a play on words. The problem arose because the use of think as a noun is fairly uncommon; most people are used to using it as a verb, which is why adherents of thing in the saying claim it makes more sense than think. Try looking at it this way: the phrase itself is essentially telling you that you’ve made a mistake and you need to think again. Which makes more sense—think again or thing again? Think again makes more sense, because thing is not a verb.
Its use is uncommon enough that your characters might be confused by it:
“Slayer,” Spike growled, “if you think I’m about to let you stake Drusilla, you’ve got another think coming.”
“I’ve got a what?” Buffy asked, brow wrinkled in confusion.
At about 2:50 of this video from the program Bill Cosby: Himself, the incomparable Bill Cosby gives us another example.
Bill Cosby: I love it when they give you another think coming. If you think that I was put on this earth to be your slave, you’ve got another think coming.
In the video, Cos clearly enunciates both “k” sounds—the one at the end of “think” and the one at the beginning of “coming.” Not everyone does, however; when speaking, people tend to be lazy and not completely form the “k” sound at the end of “think.” The result, surprisingly, ends up sounding like a “g” sound… like they were saying “thing coming” instead of “think coming.”
(For a much more complete discussion of the “k” and “g” sounds, take a look at this entry of Language Log.)
While another think coming is the original version of the phrase, usage of another thing coming far outweighs it, in part because of the way it sounds when spoken, as referenced above, and perhaps also in part because of the Judas Priest song Another Thing Coming. If one were to search on Google and compare results for another think coming and another thing coming, one would discover that the results for another thing coming far outweigh those for another think coming.
Over time, the way we hear this saying has caused it to develop the think and thing variants. Regardless of whether you use think or thing in your own writing, be prepared for people to disagree.
The Phrase Finder
Language Log entries here, here and here
Dictionary.com - Dictionary of American Slang and Colloquial Expressions