Why re-invent the wheel?

I'm not clear as to the application - but obviously the pump is used to either empty something or fill something.

A small plastic sump/tank, holding both the pump and a float switch, would only run aslong as it took to pump out a 'flush.' Or, a similar arrangement would fill the tank.