I agree with the general consensus… if she withdraws her hand right away, and/or says “Excuse me!” or some such, then it was really an accident. If she lets her hand linger there for a moment, it was flirting.
What you should “do” about it depends on a lot of factors, I suppose. Are you taken too? How taken is she? (Are we talking married, long-term relationship, dating a guy, etc.?) Are you attracted to her? If the flirting would need to be “harmless” flirting (i.e., if you’re both taken, have no intention of changing or endangering that, etc.) then are you okay with harmless flirting between taken people , or does it bother you? And so on. No one response is likely appropriate for all scenarios.
But I definitely would say… You talk about taking her hand as a way of “flirting back harmlessly.” I don’t think that’s just flirting back… that’s escalating the flirting. After all… she didn’t take your hand… she just touched your hand. Flirting back harmlessly would be doing something like looking for a chance to position yourself to “accidentally-on-purpose” touch her in a similar way, etc.
If she touches your hand now, then touching her shoulder later says “Hey, I appreciate that you think I’m attractive, and I think you’re attractive too, even though we both know nothing’s going to happen, so I’m playing along.” If she touches your hand, and you take it in yours, that says “Hey, now that I know you’re into me too, let’s blow this taco stand, sneak away from our significant others, and have some fun…” ;-)