Why did the share prices go from the 10s of % to 95% or more?

Because people were buying the shares: supply and demand. And of course they were buying them because the general opinion on McCain's chances was changing. I'm not disputing that.

Because I correctly forecast everything important about the bet: that McCain had a much higher chance of winning the nomination than everyone else did, and the market was wrong.

Yes: you basically did the same thing investors do when they believe a stock is undervalued. I'm not disputing that either.

Why does it matter that at some point I closed out my contract?

Because you were able to close it out for any reason at all other than the actual outcome on which the bet was based. The claim to which I originally responded in this subthread (which wasn't made by you, btw) was this: "You win a bet if you get the result right, e.g. You predict the result of an event. You don't win by guessing the beliefs of others. Sure, you can trade in and out of a market as opinion changes, but you are still betting on a result and not an opinion."

Strictly speaking, this is only true if bets (or shares, or whatever you want to call them) cannot be traded. If bets can be traded, then other possible strategies open up that are not possible if bets cannot be traded. You played one such strategy: you correctly predicted that a certain bet (on McCain winning the nomination) was undervalued, so you bought it and waited for the price to go up. When the price had risen enough that the extra gain from continuing to hold the bet was less, to you, than the risk of him keeling over (i.e., less than the benefit to you of risk aversion), you sold your bet.

Such a strategy is not possible if bets cannot be traded. Suppose trading of bets had not been allowed in your case; you would have had to make your original bet knowing that you could not sell it, but would have to hold it until the actual outcome--i.e., you would not have the opportunity to lay off the risk. That would have changed the expected benefit to you from the transaction. (Whether it would have made a difference in what you actually did, I can't say; but it certainly would have changed at least some of the factors on which you based your decision.)

It is quite true that you chose to play this strategy based on your (correct) prediction about the outcome, that McCain would get the nomination. But that doesn't change the fact that the strategy itself, the one you actually played, depended on their being other players in the market to whom you could sell the bet when your desire for risk aversion became large enough. In other words, it depended on trading of bets being allowed, and on other players having different valuations of the shares than you did, so that you could find someone to trade with. So even if you "won" in the sense of correctly predicting the outcome, and realizing a payoff based on that prediction, the opinions of other players in the market still made a difference. That's what I was trying to emphasize.

it doesn't have to be differing estimates. It could also be risk aversion, liquidity constraints, noise, or a bunch of other things.

Technically, yes, there are two general kinds of reasons: differing estimates, and differing values. But in practice they basically amount to the same thing: your expected benefit from various possible courses of action is different from someone else's. That's the key thing that makes things like trading bets possible at all (that and whether or not the particular market in question allows trading bets to begin with).