I agree - pellets should be the main betta diet, and supplement with bloodworms. I put a little bit of tank water in a plastic cup and soak some bloodworms in there for a few minutes before feeding. The bloodworms absorb the water in the cup and swell up a little bit. When you feed dry bloodworms, they soak up moisture and swell up in the betta's stomach, which can cause a temporary bloat. But your fish looks more bloated than just from diet. Dropsy can have many causes, like Mosaic said. It's hard to know what med to get because dropsy can be bacterial, parasitic, or from an internal disease like a tumor. You could try using epsom salt to draw out the bloat. Use a QT tank to avoid harming the snails. Try about 1/4 teaspoon of epsom salt per gallon.
Peas (the kind we eat!) can sometimes help an internal blockage. Boil some frozen peas (canned ones get too mushy) on high for about 4-5 minutes. Let cool and squeeze the pea away from the skin. Throw the skin away and cut the rest of the pea into little pieces that are the same size as his other foods (he'll accept it better that way, if it's small). If you can get him to eat some pea pieces, then don't feed for a few days to give his stomach a rest.