I think your method might be better i.e subtract final total count from valve-off counts to get the offset to use.
The attached PDF has my method (count pulses after valve off until stop to estimate in-flight); I had to add a fudge factor of 1 count when using that estimate. Also, this seems way to complex.
LAD 3 models a flowmeter pulse for a (Cv)-fast-opening valve that takes about 4s (4k scan cycles) to go between full open to full closed in either direction.
I'll take a look at this in the meantime and let me do some tinkering. Thank you!
(feeling the knowledge grow!)