Regarding the case of having a companion kill the shopkeeper, the act of giving the command should be what affects things, rather than the attack itself - I'm assuming, here, that companions require verbal commands (on that point, can a mute PC give orders to companions and pets?), which would then be heard by the shopkeeper and villagers, and presumably by the gods (cursing, etc) and certainly would affect/reflect your mental bias (alignment).
By the way, can you create traps in shops? If so, what happens if you create an Alarm trap in a position that the shopkeeper might step on?