What is the enclosure like that you keep him in? Do you have a picture? If he is eating sporadically like this, he might feel a little un-safe in his house.
Also, no I do not find a correlation between when the snake "needs to poop" and when they will eat. If they are hungry they will eat. If they need to poop they will poop.
Also, do you feed this snake in its home enclosure?