I don't know what the official time rule is for keeping in the mesalamine, but for me I am usually pretty pleased if I can keep it in for two hours or so. I find that the more I need those "insertion" meds, the harder they are to keep inside and since you are taking two doses a day, you may be getting enough benefit especially if you are keeping in one longer than the other.
With the suppositories, if I could not keep them in longer than an hour or two, I would insert another after I had voided.
I also really concentrate on squeeeezing those sphinster muscles and do some deep breathing because sometimes after a minute or two the cramps pass and I can hold off voiding for another hour.
It is truly a humbling method, but the benefits of rectal medication make it almost worth it! No, I joke. It is totally worth it.