Hi!
Two years without biting is a very positive sign. Don't let this one negative sign or incident scare you. It doesn't mean that she's going to begin biting, it just means that you crossed the line somewhere.
None of us enjoy getting bit, but in most cases, and I'd say most likely this one, it's a good thing. It usually shows that we have let our guard down. Remember, we shouldn't fear our captives, but we should never lose our respect for them.
Like you said, they are wild animals and anything can happen at any given time. However, they're pretty predictable.
It sounds to me that your snake was most likely in a state of trance and something you did (your movement, the direction of your movement, etc...) caught your snake off guard & it struck out of defense. Odds are that it most likley acted as if nothing ever happened after that. It was then fully aware of what was going on.
Just about anytime a snake lies motionless for any period of time they go into a trance and any movement by anyone nearby should be done with ease. I would make the bed move first by gently bouncing your body or tapping your foot or something, just to make sure the snake was awake. Any sudden movement towards, or in the direction of, its head is sure to draw a strike from any sleeping or relaxed snake.
Bottom line: It's almost always the fault of the person that got bit. Especially with normally docile snakes. Depending on the circumstances it could range anywhere from feeding issues, to temperatures, to sudden movements, and on and on... But in this case, I'm betting you just startled her, and as long as you remain conscious of your movements it's not likely to happen again.
Hang in there!
HH
-----
Due to political correctness run amuck,
this ol' hillbilly is now referred to as an:
Appalachian American

www.natures-signature.com