Here is a story that applies here:
There was a priest that asked if it was proper to smoke while praying. He was told no it would be disrespectful to god. So a few days later he asked that if he happened to be smoking would it be acceptable to offer a prayer to god. The answer was affirmative. It would be fine if you were smoking and then decided you wanted to give thanks.
In this situation replace the word "poop" with "smoke" and you will get the answer.
So, if you happen to be pooping, or another body function and someone is offering a prayer, I think that would please god.