Ok, funny story...
I'm out doing an assignment for USA Today of this local guy who had invented some new kind of turn signal (seriously!). It's the middle of the day and we agree to meet on a lightly used overpass over I-35. The idea was to get a nice compressed long lens shot of the guy with the traffic streaming on behind him. We meet and I quickly setup a strobe and a ladder (everything was out of the traffic lanes, by the way). While I'm setting up, I joke with the guy and say "don't be surprised if a cop shows up to see what we're up to". Not ten minutes later, I'm up on the ladder and out of the corner of my eye, I see three cop cars racing up the overpass. Once they saw us, they slowed, pulled over and the officer from the lead car calmly approached us. immediately, he gave the other guys a hand signal to stand down or something. The cops were actually really nice about it and after giving them the specifics, the lead guy explains that someone called in and reported that there was a guy on the overpass brandishing a gun! He chuckles and says something to his buddy about how anybody could mistake a camera and big lens for an AK-47. He then turns to me and says "Glad it turned out this way cuz we were about to go all SWAT on your ass". We all had a good laugh, they left, and we got back to work. About ten minutes later (I'm not kidding), I see a (city) cop driving up the overpass. This time it turns out that we were "taggers", up there defacing the bridge. The amazing part in all of this is that whatever good citizens reported these heinous deeds, saw us from below, for a split second, while going 70 MPH.

I've fortunately had very few problems with law enforcement in the post 9-11 years. Having press credentials certainly helps, but there are certainly things you can do to avoid such unpleasantness. Most importantly: I learned a long time ago, that if you look and act like you're supposed to be there, most people will assume that YOU ARE supposed to be there.
If all else fails, I hear the weather's pretty nice at Gitmo.