What kind of flakes? I feed mine bettamin flakes and they all do very well on them as a staple. But, like has been said, it needs to be a flake made for bettas, not just a tropical flake. Are you rehydrating the freeze-dried bloodworms before feeding? Sometimes they can expand once they are ingested leading to bloating.
You will need to fast him until he returns to normal. Then try feeding a little daphnia or if you don't have any, a thawed, deshelled, and mashed up pea will work for now until you can get some. Basically, the fiber will not be digested well, and in the process will "clean/clear" the digestive tract.
The diet that I feed my bettas consists of bettamin flakes (you can use a good quality pellet as well) as a staple. With alternate feedings of frozen bloodworms, brine shrimp, and daphnia throughout the week. I usually use the daphnia on a day when I don't feed them in the morning, then give them a little daphnia at night.