The diode is absolutely non-critical. It has to handle a peak voltage of √2 ×24 ≈39 v, and at least 20mA. A plain old 1N4148 is up to the task, as is any of the 1N400x series.
As far as the cap, you don't even need one if your code will tolerate a square wave. On for half a cycle, off for half a cycle, on for half a cycle....the first time it's off for more than a cycle means the pump is off.
If you use a cap, you want the capactitance to keep the LED on through the half cycle and not much longer. I'd do some experimenting. The cap should be across the LED and series resistor.