I have had several reticulated pythons do that when they struck at the feeder, missed, and grabbed themselves. Most of them figured out pretty quickly what happened and let themselves go, but I do have one female that held onto herself and made a big ball-o-python for about ten minutes and she has no neurological problems.
Fortunately their teeth are pretty short for their overall size, so even when they do bite themselves they don't do a lot of damage.