AFAIK the biggest risk is disclosure. Some states (Oregon for sure) explicitly require the seller to disclose unpermitted work. It's part of the standard forms you fill out with your realtor when making the listing.
They won't stop you from selling the house as-is but some buyers will walk, some will demand you get it permitted, most will at least want a real inspection done. Getting as-built work permitted after the fact will cost 2-3x as much in permit costs than it would have if done properly, and it may require you to remove drywall to expose things for inspection, but as long as it meets code you won't have to rip everything out and have it redone by a licensed person. In most places you can do work on your own house, so it's the lack of permit that needs to be remedied.
Home inspections are pretty normal when you buy a property. I have no idea what work on my >200 year-old house was permitted. While the latest batch was, I'm guessing a great deal wasn't. But I don't actually know. And, if you're buying a >200 year old house, you know that along with a lot of other things.