She's being FRESH.
When dealing with "give inch, take mile" people you really can't do a "soft" let down like
basically saying that he was mono, that was not going to change for anyone, least of all her, and while the flirting and flattery she was sending his way was fun, he expressed concern that it looked like she wanted much more than simple friendship.
- Established that flirting and flattery is fun to him. (In her mind -- Yay!)
- Established he knows she wants more than friendship. (In her mind -- Yay!)
- Established he's "concerned" (In her mind -- Yay! He cares about me!)
- He's posed a "challenge" -- that he's not gonna change for anyone least of all her. (And in her mind it's is probably like ... "oh, really! You coy thing you!")
To a certain personality, they rewrite it all in their heads as "playing hard to get." So here she comes again with the hair twiddling! Par for course. She doesn't much care about his comfort... she's after her own jollies. She got them.
If he's going to be uncomfortable anyway? Could pick his uncomfortable.
To me? Whole lot easier to call her on it in the moment if she tries again. Something like grab her wrist and get her hand out of his hair and loudly say "STOP being fresh! DO NOT twiddle my hair. You are not my wife or my gf." And let everyone stare at her for her behavior.
I'm guessing if he does that she will rewrite the story to disown her behavior like "he took it all wrong" or is "he is too sensitive" or "he thinks he's god's gift to women" or something. But it stops the nonsense. And once she knows he might call her into account in public like that, she'll think twice about doing it again.
Right now he's teaching she can get her jollies (this time it was overfamiliar touching) and all that happens is another email slap on the wrist that only she sees. Which she can rewrite in her weird head to suit her. It's attention after all. She "wins." She got attention from him. And she learned neither he nor his wife say boo to her when her inappropriate behavior crosses the line at gatherings.
I am guessing there will be more shenanigans to come. Til your friend calls her into account where more than just her sees and/or cuts off all contact.