Sounds like a urate stone (aka "cloacalith")...they can block their cloaca making it difficult or even impossible to pass urates & feces, sometimes requiring a vet's
help. It's hard to say if this is related to the difficulty you've had getting him to eat, because (a) ball pythons are KNOWN for being a challenge, (b) it might have
been seasonal -BPs do NOT actually brumate, but a chill in the air & shorter days can put them off eating -in the wild, snakes that get caught with food in their gut
& unable to digest because of chilly weather can die when the food rots in their GI tract, so they rely on instincts even as captive pets...they don't "know" we're
going to keep them warm enough to digest....and (c) we need LOTS more info about how you're keeping him to fully help you...meaning what kind of cage? what
kind of heat? how is it regulated? what are the hi & low temps in his cage? substrate? humidity? -what kind of hides does he have, etc. Pics do help...
You want to feed snakes on a "plate" of some sort (can be a cardboard box lid, etc) so that they do not ingest substrate. While snakes may ingest such debris in the
wild, it's better avoided as these are our pets and they cannot digest wood/plant fiber...if it's at all sharp, they can puncture their insides, causing infection & death.
Most of the time, such debris gets expelled along with other waste, but vet bills aren't fun, & when you can avoid the risks it's best to do so.
Urate stones do look much like a marble**, and the fact that you were "pushing on him" & "massaging" you may have caused the bleeding. Pics of what came out & his
cloacal area, along with his set-up would all be helpful here. It may be that all is fine now...but if you see any more blood you should take him to see a good herp vet*
a.s.a.p. (*have you located one in your area, with experience???) I have a hunch (& hope) that the biggest reason your snake isn't eating has more to do with things
you can & should fix...especially since you've always "had trouble feeding him". Is he fed live or f/t? Rats or mice? Sometimes it's just a matter of improving your
techniques, but also if his cage isn't warm enough or offering enough "security" that's another common reason that snakes won't eat. Also, if handling is excessive.
So you see, there's lots of variables...
**And btw, urate stones do NOT "look like part of his insides"....that part I'm not understanding your meaning. You may have caused a prolapse...and that
requires proper medical attention if so.