Without taking all day to try to delve into that code here is the typical reason to do the flow rate method.
Typically flow rate is used for continuous streams of fluid. Since the sensor only indicates a granular measure, in this case 2.25ml. If the flow is much less than that per measurement time then you quickly loose the ability to know what is happening.
With a continuous flow, you can use the sensor timing to know how much volume is passing/second and as such can know the volume for a given time more accurately than just in counts of 2.25ml.
However, if what I am reading from the code is correct, they are measuring shots of alcohol, so it's not exactly a linear flow unless there is a party happening I was not invited to.
The OTHER reason is control. If you want to turn off a valve when exactly 20mL of your finest Scotch has been dispensed, then that's 8.888 pulses from the sensor.... The only way to do that accurately is by using the pulses to calibrate a flow rate, and then time the off signal.
ADDITION: Another reason I have used in the past for a different kind of measurement system that metered out printer ribbon over a measurement wheel roller was because of the slip factor. Not sure if this device has that phenomenon, but inertias and slippage in the system can cause the first few pulses from metering devices to be a little slow when switching between stopped and run.
By turning on the value, then monitoring the sensor to get the stable flow rate, it lets you calculate the time needed to dispense at that flow rate. That method effectively gets rid of those issues AND the "not sure where I started" issue.