Trying to be a hero is usually foolish. That is not to say that one should hide, but that one must exercise caution and good situational awareness. If you have time, I would think the best thing to do would be to assess the situation from cover before engaging. I also believe in engaging only as a last resort.
I CCW because I don't want to be a victim. I had a gun pointed at me in a school incident at the age of 14 (thankfully nobody was shot). Not only do I never want to feel so defenseless again, but I don't want my kids or someone else's to experience that feeling either.