My network blocks SIP on 3G, so when I start using its 3G service after leaving a wireless network my N900 constantly complains about not being able to connect. Although this is my specific annoyance, there are many similar requests, such as I only want my work XMPP account enabled when I’m at work.
I wrote a simple application to achieve this. A list of wireless networks is configured per instant messaging account. libconic is used to listen for connect & disconnect events. When said events occur, accounts are enabled or disabled as configured.
I just uploaded it to extras-devel. It’s called Automatic Connections.