I can't find the right word for what it was called, but when my son went through something a couple of mother days ago. He seemed fine during the day, but at night he would wake up in terrible pain. He was unconsolable, then all of the sudden he would stop fall asleep and it would start again. It seemed to come in cycles.
We took our son to the doctor twice. The first time she did mention what he end up having, but sent him home saying it was a virus because he was older than the norm for it. The second time I took him back. She felt his stomach area and he said it hurt when she touched him. This time she sent us to Rainbows for an ultrasound. To check his appendix and for the other condition. The other condition is when your intestines fold in on itself. They found this in the ultrasound. They were able to correct the situation with a barium enima. If they could not correct it with this, my son would have gone into surgery to correct it. When this happens it cuts off blood to that area of the intestine.
If found it intussusception. http://children.webmd.com/tc/intussusception-topic-overview
I know it says it happens in children 2 and under, but our son was older. And I do know of a 5 year old that had it and his mom toke him to the hospital several times before they figured it out.
I hope this helps. I'm not saying this is what your son has, but it helps to have info. Especially when the child is outside of the normal age range for the condition.