It's a very popular (Western Culture?) theme for people to get what they wish for and regret it.
That entry OAALD entry for "wish" didn't mention that this is something akin to an aphorism. It's something that someone says in response to someone else wishing something out loud, and it's always said in just about the same way, and the other person understands what you mean.
John: "I wish I was famous."
Jane: "Be careful what you wish for, you just might get it!" (Fame comes with negatives.)
Mary: "I wish I could live to be 200."
Bob: "Be careful what you wish for! (It might be very unpleasant.)
One of the best resources on popular American culture is http://tvtropes.org. In particular, you will find volumes of information on this that will help with context at http://tvtropes.org/pmwiki/pmwiki.php/Main/BeCarefulWhatYouWishFor.
This might make sense related to a Chinese proverb 點石成金 (possibly translated "turning stones to gold" aka "Midas Touch". See http://mandarin.about.com/od/chineseproverbs/a/Chinese-Proverb-Dian-Shi-Cheng-Jin.htm and http://www.windsorchineseacademy.com/chinese-proverb-dian-shi-cheng-jin.
Another reference is to a (possibly pseudo) Chinese "three-fold curse": May you live in interesting times, may you find what you are looking for (may your wishes be granted), and may you come to attention to those in authority. (References: http://www.answers.com/topic/may-you-live-in-interesting-times#ixzz35a95aVmy and http://asiancha.blogspot.com/2011/07/chinese-curse.html)
And finally someone from a wikipedia talk page refers to 求仁得仁 as possibly a reference to "the third curse" (see page if it makes any sense).