Well... When it comes to reputation, i think that solution for this problem is very simple. This is my suggestion:
You gain reputation exactly the same way, you loose it.
First - For killing some group or faction, you gain reputation in the place/factions where your opponents are not liked. So if you kill enclave patrol, you will gain reputation f.e. in BoS.
Second - If you kill raiders/mauraders etc. near some city, it is considered to be a good deed since that group might have been a threat for the city.
Obviously - you can gain only less reputation than you loose killing stuff... So being a total ass and than killing some raiders wont help you regain reputation just like that. And obviously to gain reputation back, you will hve to kill something - so if you start killing some factions, you will never be neutral for every one of them. So if you killed some raiders and then realised you need SG3, you will have to kill Rangers and or BoS patrols. Meaning - you willloose reputation somewhere else = you are still screwed a bit.