"Laid by the elusive cocoa bird. There's a surprise inside!"
Upon buying the Chocolate egg upgrade, 5% of your current cookie bank will be added to your bank, and will count in your "total earned". There is no upper bound, making this upgrade potentially the highest producing event. The Chocolate egg costs 3PEx999 cookies (without taking discount upgrades into account), where PE is the amount of purchased eggs.
To make the purchase of this upgrade profitable you need to have a minimum of 21 times its cost. This means that if Chocolate egg is the last (20th) egg you purchase, you need to have more than 24.383 trillion cookies in your bank to make it profitable.
A strategy could be to not buy the Chocolate egg upgrade at all during a run, but rather to save it. When players are ready to reset, they can sell all their buildings, and then buy the Chocolate egg. Likewise, during the end of a run, it may be wise to not spend ludicrous amounts on buildings, but simply keep the cookies in the bank (because selling them returns only a quarter of their cost). To maximize the effect of Chocolate egg, "Earth Shatterer" dragon aura can be selected to take advantage of the 50% return on selling buildings, then selling all buildings and purchasing the Chocolate egg. This way you add more cookies to your "total earned" cookies, and therefore add more to your Heavenly chips. However, if you are aiming to get the "Lucky digit", "Lucky number" or "Lucky payout" in your next ascension, you should buy the Chocolate egg before selling buildings, since you can't quickly calculate the amount of prestige you are going to get.