I don't think he's in pain from folding some of his scales back...it happens many other ways too. But considering that some snakes (esp. BPs) have been known to
sit on excessive heat to the point of getting 'burns' (which I'm sure does hurt though maybe not at first?) it's hard to say. I'm sure snakes do feel pain & do back
off when rodents bite back, for example, but it's easier to just concern yourself with whether or not he is injured. You want to avoid not only his pain but infections.
Bent scales, meh...