Maybe someone else will have a better answer for you, but here's my experience with follow and companions...
If when you created the NPC Jim you gave him the AI package follow and entered Player in the box that pops up, Jim will almost always be your follower as far as the game and combat is concerned. Setting follow to 0 and giving him an AIwander as his current package only prevents him from following you around, but if you are attacked, he will often (not always) join the fight on your side anyway. You can create creatures and place them around your house or stronghold as guardians, and they will wander until a hostile creature shows up, then they attack.
I think perhaps this is a bug in the game engine regarding AI. Quite often stopcombat won't work either, or the NPC will stopcombat for a few seconds and then attack again. Perhaps MCP could come up with a solution if you presented the problem to Hrmchnd. I'm afraid I don't really have a solution to offer.
[EDIT] After thinking about it, it occurred to me that i've been looking at this from a purely linear point of view... that is, only considering the problem from one angle.
Here's an alternative thought that might work better. Try changing the script so that jim approaches Bob, but no startcombat. Then attach a script to Bob that has something like:
if ( Getdistance, "Jim" <= "xnumbergameUnits" ) startcombat, "Jim"endIf
The Player probably won't even be able to tell who attacked who first if the distance is short, and guards won't go after the PC or Jim (hopefully) and no bounty would be added. This of course assumes that Jim doesn't hit a guard, or something stupid like that, eh?