Optifine is not compatible with versions of Forge above 499 and will hang at world gen in SSP in versions above 505. The Optifine mod author is trying tot track down the exact cause but says the issue is quite exotic and honestly has no idea what is wrong. You can still use it with the client on newer versions of Forge in SMP environments only but if you want single player you will have to disable Optifine (or roll back to an older version of Forge).
P.S. Keep in mind that newer versions of ExtraBees and Iron Chests require a newer version of Forge than what is officially supported by Optifine.