Is this what you are after?
dat %>%
mutate(cumdist = seq.int(n())[order(VALUE)] / n(), .by = YEAR)
which gives
YEAR VALUE cumdist
1 1999 1 0.2500000
2 1999 2 0.5000000
3 1999 3 1.0000000
4 1999 2 0.7500000
5 2002 1 0.3333333
6 2002 2 0.6666667
7 2002 3 1.0000000