Shares of Hershey wavered Thursday as investors digested the chocolatier’s quarterly earnings report, as soaring cocoa prices cut significantly into the food company’s profits.