There are several ways to do this.
One idea is to use two programmable (down) counters in parallel. Both are loaded at the same time, one runs at your desired 20 ms period, the other at your variable pulse length. Gate the outputs together, and you have a solution.
Another idea is to run just one 20 ms counter, and decode its output.
And, and, and...