I had a time in my life where it hurt every time I ate. I was told I had gastritis and was advised to follow a clear liquid diet for something like 72 hours. I also was given a prescription for axid. Many years later, I was diagnosed with gastroesophageal reflux disease. Did they rule out appendicitis? Have they checked for any gallbladder or duct issues? When I was in nursing school, they told us that green stool indicated too much sugar in the diet. Don't know if that could be the issue with your son or not. I think I remember once I had bright green feces from drinking gatorade.
Has your son seen a pediatric gastroenteroloogist? If not this is who he needs to see ASAP. IBS can give you a feeling of having to have a BM but you really don't, and can spend a lot of time trying. It can also cause gas pains. Children can develop a ulcer and this may be what is wrong with your son. Giving him Maalox is putting a bandaid on the problem, and you want to know what the probblem is. My son had one at 12, it devestated me because I thought an ulcer at 12! But they said it is fairly common. I think he needs to have an endoscopy so they can look inside and view his stomach and find out exactly what is going on. I hate that he has endured this for four weeks and I know it breaks your heart. Green stool has many causes, most benign, but his pain is of concern and his rectal pressure. If he is seeing a GI doctor, you're not getting the answers you need and I would seek a second opinion with another Ped. GI specialist. This is their field and they know best. Good luck to you both and take care.