I have a few issues with the advice given here.
1.) I have never had issues handling ball pythons during the day. I would say the advice of holding the animal during a time it is searching for food would be misleading and probably add another reason for the OP to be struck at as the animal has already shown signs of defensive behavior.
2.) "Knocking on the animals hide" probably isn't a great idea either seeing as how that is its form of defense and place of comfort. To me that's like saying "shake the beehive before you pick it up..."
3.) The "stroking" you are referring to after you have knocked on its hide, upset it and caused it to be defensive will only piss a BP off more. I have found that simply taking a pen or whatever you have near you and gently tapping the animal on the head to take it out of food mode (which could be what is wrong with the OPs animal) works better. **I DO NOT MEAN BEAT THE ANIMAL OVER THE HEAD... It's literally touching the top of its head.. I know someone will think I'm advocating hitting it in the head and that's not accurate.** Rubbing their sides will only cause them to be more defensive and cause for the snake to sense the heat of the handler and lunge at it. That's actually a great way of getting bit to be honest.