1
APL (Dyalog Unicode), 35 bytesSBCS
Infix tacit function where ended is 2, ongoing is 1, invalid is 0, smaller and larger scores are left.
(,≡30 31|,)×(⊢<2+X)×1+⊢>X←29⌊20⌈1+⊣
Try it online!
Implements Erik the Outgolfer's mathematical formulas combined into
$$X:=\min(\max(x+1,20),29)\\\ ([X