I think the most appropriate action would have been to say "Excuse me ma'm, I don't want to appear rude, but I'd feel much more comfortable if you wouldn't stand so close while I'm doing this." If she doesn't comply, halt your transaction and allow her to go. Wait until you've got another shot at it. If there's a line behind her, explain the situation to the next person behind her and ask if it's okay with them that you go after she's finished.
I don't like it when people do that to me either, but there's a sign at the ATM I use (which is about once every 6 months - I buy
everything with credit) that says "One person allowed at ATM at a time" and there's a door and everything. So if they came in, I'd stop and say what I recommended above... that, or "Get the fuck out of here! Can't you read the fuckin' SIGN?"
Ya know, whatever happened to roll off the tongue first.