i think being scared of pooping is quite common at this age. he probaly had a painful BM, so he holds it in fear, which of course makes it painful again. my sister and i both had this issue with our kids at 3. pooping in the potty was so much harder than the pee.
just completely lay off pooping in the potty. and i would also stay away from the meds. he cannot NEED them to go, kwim. you need his body to go naturally, not medications. instead, try to get him to eat the kashi autumn wheat, the cinnamon one is better. it works. also feed the fiber but pay attention to what kind of fiber, you want insoluble. too much soluble can actually constipate you. you want the skins of the fruits. blackberries and raspberries are great. blueberries, pears, then vegetables. seeds are good. also make sure you get rid of any white flour items like white bread, cookies, ect. all that stuff causes problems. get the fiber bread and english muffins. and get flaxseed. it doesnt really have a taste. you can add it to yogurt, applesauce, but also sprinkle it on things like chicken. its very good for you and has lots of omega 3s. you need to get him to go as easy as possible for an extended period so he doesnt remember the bad time.
as far as the potty after he is regular. let him go in the pull up, once thats going good, tell him he can go in the pullup but just do so privately in the bathroom. focus on that first before trying to get him on the potty. most likely, he will be on the potty one day, and go accidentally and realize its not so bad. then he will prefer the potty to the feeling in the dipe. if he is potty trained otherwise, let him wear underwear, but he can ask for a pullup when needed. that worked great with my nephew.
honestly, this issue was alot of work, one of the hardest. good luck, it will get better. its so hard for them to understand!