sorry you're having such a hard time. but don't get discouraged. it is normal to still have cramping 3 mons post op. for many ppl it can take up to a year till the intestines settle down and function normal again, and esp if you had emergency surgery, the trauma may be harder on your system.
some foods are better avoided, like fiberous foods/whole grain, which means fruits, vegies, whole grain rice, bread etc, nuts, seeds - all these should be avoided. it is important to keep a low fiber/low residue diet. when you feel things are more settled down, you can try add more foods in small amounts and see how it works.
the mucous needing to come out is causing pressure on your lower abdomen, so it causes pain. if you havn't had any output thru the anus for 3 mons, it makes sense that quite a bit has been building up in there and you havn't passed all of it still. for most ppl with loop stomas (temporary stomas) it comes out easily. i don't know why you're having trouble passing mucous easily. it could be your body was in trauma from the surgery and that's why you havn't passed any so far and didnt even feel the need, but looks like things are starting to wake up and hopefully you will be passing it more easily on your own soon. but for now, if it doesn't come out on it's own, don't hesitate to try an enema to help with it. hope you have relief soon!