I've posted this same idea at ESOUI as well.
http://www.esoui.com/forums/showthread.php?t=5558
I always play with this setting turned on. Today I was pick-pocketing inside a house and forgot that NPCs will sometimes attack you if you are caught. I got attacked and could not fight back due to having this setting turned on. He killed me before I could find the setting and turn it off. Is it possible to write an addon that would allow toggling this setting via a chat command like /harm (as in "harm innocents")? If someone wanted to get fancy, perhaps even have a message display onscreen or in chat that says "Prevent Attacking Innocents Is Now
OFF" or "Prevent Attacking Innocents Is Now
ON".