When was the last time that you fed her? If she was napping (and it's hard for us to tell, since they don't have eyelids) and then woke up suddenly and saw movement, it may have been instinctual to quickly "ambush" the prey that suddenly entered her enclosure.

Getting bitten when you own snakes is inevitable at some point - they're still instinctual animals. The fear of a bite from a ball python is far worse than the actual bite itself.