I don't have any suggestions on how to make her stop.
But, I will tell you that my nephew has always twirled his hair around his finger when he's tired. So bad that it knots up, and some gets pulled out. He's been doing it a lot less lately (he's almost 4), so hoepfully he's just growing out of it.
Maybe just distract her a bit? Just take her hand in yours and rub her hand a little? GL.