If someone shoots at you, return fire.
What is the point of not shooting back? If you get killed, at least you didn't shoot back?
Just know that you are responsible for where your rounds land down range. If you return fire at a car doing a drive by shooting and you put bullets in a house behind the car, you are responsible for it.
If you are hunting and someone shoots at you, and you return fire and kill them, you may have a hard time proving that person was shooting at you. If that person is accidentally shooting at you, thinking they see a deer (I can't figure out how a person resembles a deer), then maybe return fire in their direction to let them know you are there? Do something to stop them from shooting. If they continue to shoot, then use your discretion on whether you need to shoot them.
Bottom line is, you are going to have to answer for your actions. Whether you were in the right or wrong. Are the possible ramifications worth still being alive?
I was considering a similar situation the other day. Pull into my driveway, my kids and I get out of the car. A neighbor's dog comes running down the sidewalk growling and barking. I had my hand on my pistol, ready to pull it out. The dog had stopped short because my neighbor yelled at it. Had it reached me or one of my kids and attacked, I may have shot it. In my mind, the ramifications of discharging my weapon in town and shooting the neighbors dog outwieghs the result of one of my children being scarred for life. I do not know if it would have attacked if my neighbor wasn't there. The dog seems to be all bark and no bite...