I've brought him to the vet for these reasons along with a bacterial infection that he had in the past, and they believed it had been because of a source of pain, but he no longer has the infection and still does this. The infection took a while to go away and kept reappearing, but I don't see many signs of it anymore except that his stool isn't perfect. The vet I go to is an exotic pet vet that specializes in reptiles, and even they haven't had much experience with this type of issue.

I think his scales are shaped weird because he bites himself a lot. He just shed recently and looked a lot better (still had scars), but now I am wondering if there was some kind of scale rot going on because I didn't know what that really looked like til now, and I thought they were just his wounds healing into scabs. When he bites himself, I wash him off and let him soak in some water with a little bit of antibacterial soap. Also, he's only tried to swallow his tail as if he were eating it a few times, and he usually bites it from the side.

I was thinking there was a problem with his enclosure. He lives in a 40 gallon, which maybe is too small? He likes to roam a lot after he passes a bowel movement and acts like he is in hunting mode way earlier than he should be. He also does a lot of constriction around my hands, bites often (only bit once before he got ill), and can be very quick and over-alert. I thought that maybe he was very stressed, so I got some new hides and plants for concealment.

I have a photo of his enclosure:


The left side is the warm and the right side is the cool. (When he bites himself, he usually does it around a plant or something, which he strangles the plant while hes biting himself. He does do this around a little tree hide that's supposed to be on the right, but I had to take it out because he hurts himself worse on it. He does like to sleep in the empty rock water bowl though, but I don't know if that would count as a hide.)

He has a heat lamp that is on during the day and a heat mat with a thermostat that is on at all times. I keep the thermostat a little higher because he has a thick layer of substrate and he doesn't usually burrow on or near it.