Also, the threat of being competed against may never materialize. Facebook can build so many apps, but they won't build them all.
This, I think, leads to the real litmus test for me: how sure are you that the company is 100% committed to being an open(ish) platform rather than building out its product? The parallels with Microsoft, Apple, and Facebook are quite interesting to explore.
If your plan is for the company behind the platform to buy you, you need to consider carefully the kind of cash they have for acquisitions and how often they do talent acquisitions. The chance is much higher with some companies than others (assuming your product is worthy).
One, that the risk of that happening should have been obvious at the start, so it's silly to feel burned.
Two, if you do build some add-on feature to someone else's platform then the challenge is to do it so well that the company behind that platform offers to buy you. Tweetie was so good it could not be ignored, Twitter loved it, they wanted an app, buying it would save them the effort of writing their own, plus talent is scarce. Thus, they get bought.