I've figured that this isn't possible.
A workaround I've come up with is to set the gadget's default height to 0, then use javascript to find out whether we're on a homepage or an individual post and then, depending on the requirement, resize the gadget to the desired height. In such case, it is necessary to include the <Require feature="dynamic-height"/>
in the ModulePref section of the xml file and use the gadgets.window.adjustHeight()
function.
The caveat with this workaround is that the gadget, event when its height is set to 0, will take at least 10px in height.