I wouldn't suggest patting a snake in strike position on the head personally. It just seems like a way to stress it out further.

Focus on the mid section. Make contact, hold your hand there briefly, then lift the snake up. The gentle but constant contact will take them out of "where is it going to attack from" mode and will eventually serve as a calming proccess.

If you're really worried about a bit, put a glove or even a sock over your hand. Just becareful when holding the snake because they can't hold onto cloth as well as your skin and are more likely to fall.