If you place a small resistor in the ground side of the load current, then it's easy to use an op amp (**broken link removed**). A 10 ohm resistor would give you a 220mV signal across the resistor at 22mA (Are you sure the motor only takes 22mA?). The op amp output goes to a comparator that is set to trip at the desired current. The comparator then triggers the flip-flop.
The complete function takes a reasonable amount of circuitry to do. I would suggest doing a block diagram (state diagram) showing the sequence of events for both opening and closing the valve. From that you can generate a functional block diagram of the circuit blocks (amp, FF, comparator, etc.) to perform the events. Then convert the blocks to a circuit schematic. The logic functions could, of course, be done by a microprocessor.