Solid or liquid
TSA lists solid chocolate as a yes for both bags. Its entry for liquid chocolate is a yes in your carry-on only at 3.4 ounces or less.
A chocolate spread follows the same rule as peanut butter. TSA’s travel tips put anything you can spread over 3.4 ounces in a checked bag.
Flying home from abroad
TSA’s answer covers screening at US airports. On the way home you go through the other airport’s screening first, and its rules are the ones that count there.
Coming home through US customs
There’s no customs answer for chocolate: CBP and USDA don’t list it on their pages for travelers. Declare it with the rest of your food.
Declare it either way. USDA says declared food brings no penalty, even when it’s refused. What happens if you don’t.
TSA puts this on every entry: “The final decision rests with the TSA officer on whether an item is allowed through the checkpoint.”