How to disable cellular when WiFi is present? I perform all my communication via the internet (Jabber, SIP), so I only need cellular as a backup.

Additionally, coverage at my home is near to nonexistent and as a result, battery drains in a few hours (as opposed to few days when GSM is disabled).

Is there an app for disabling cellular communication entirely (airplane mode) if a WiFi network is present, and enabling it otherwise?

I'm not interested in solutions which disable just the data connection: Android handles that already.
I'm OK with solutions which require rooting, rebuilding Android, etc.
You can give a try to an app developed by a XDA Developers Forum user gyagapen that essentialy the app intelligently manages switching between both your WiFi and 3G data connections as you move about:
CleverConnectivity
 

CleverConnectivity is an application that helps you to manage your data and wifi connection in order to save battery.
How does CleverConnectivity work?
This application will automatically turn on and off connectivity (data/wifi/sync) while screen is OFF.
For example if the user chooses below configuration:
Time On: 2min
Time On Next Check: 1min
Time Off: 10m
Usage check Interval: 3s
Once the screen is OFF, CleverConnectivity will keep connectivity alive for 2min. Then it will check if data is used during a period of 3s.
If data is used, connectivity will be kept for 1 minute (Time On Next Check).
If data is NOT used, connectivity will be desactivated for 10min. After this, the connectivity will be re-activated and Time On will kick in.
Once screen is ON, connectivity will be automatically re-enabled.

Links:

Google Play Store - 1,00€ No Ads
Google Play Store - Free Version (with ads)


You can give a try to an app available from Google Play Store that automatically controls your WiFi status:
Smart WiFi Toggler

Description
Smart WiFi Toggler is an application designed to control your phone's WiFi using location based rules. Its aim is to conserve battery and minimize data charges by turning WiFi off when not connected to a network, and turning it on when a known hotspot is present. It constantly learns where your hotspots are located to make its decisions.
It's a very useful application if you frequently forget to turn WiFi off when leaving a hotspot, or if you want to automatically switch from mobile data to WiFi to conserve battery whenever you're back into a hotspot.
Here are some of cool features Smart WiFi Toggler has to offer:

Automatically learns your WiFi hotspot locations.
Turns WiFi off when disconnected from WiFi network.
Automatically turns WiFi on when near a known hotspot.
Uses your network location. No GPS battery drain.
Provides the ability to control &quot;auto-connect&quot; behavior for each hotspot.
Ability to lock WiFi to a disabled state.
Warning notification and auto-locking WiFi when a hotspot is down.
History, logging, and a troubleshooting screen in case you face any problems.