You might be able to do something similar, using a motion sensor in the bathroom.
Some (not all) of the X10 motion sensors have a "+1" code that is based on the Dusk/Dawn sensor in the unit. You could use that in the bathroom to detect the light turning on, and then trigger a macro that would turn the pump on or off based on that.
However, I still think that using a SmartHome switch (one that transmits it's code when it is turned on manually) is a better way to go.