You could maybe use the EVENT_JUSTICE* events to check if you have attacked any NPC. If it fires during combat it most probabyl was not because of stealing goods
Most probably the infamythresholdtype should be one of the higher ones if you attack or even kill an NPC:
h5. InfamyThresholdsType
* INFAMY_THRESHOLD_DISREPUTABLE
* INFAMY_THRESHOLD_FUGITIVE
* INFAMY_THRESHOLD_NOTORIOUS
* INFAMY_THRESHOLD_UPSTANDING