Maybe if he'd flashed you a couple of times, your friend would've realised that she'd not switched her lights on?! D'oh!
It's definitely the right thing to do though. I had someone flashing me like crazy and putting their indicator on, which I took to mean they wanted me to pull over... I did the same, found a garage to pull into and parked right by the cashier's window, figuring if anything happened, at least it'd be on camera.
Turned out to be a mate of mine, who was utterly gobsmacked when I slapped him for frightening the bejaysus out of me!
But when you're alone in a car, late at night, you've got to consider your own safety above anything else and sadly, that includes assuming that someone following you and trying to get you to pull over poses a threat to you.