Start program in response to system events (like ip address changes, etc.)?
ControlPlane has many of the functions you're looking for, though I don't think it has any rules for connected users.  I've been using it for a few months on my work MBP to switch between home and office and it's been quite good.