Would not a simple solution be to make the cap at a cetain XP point than just blanket at level 20? perhapse at half way to level 21/at the level 21 threshold? I once, years ago played on a server capped at level 21 till you gained 'epic' status through events and such, where you gained tokens to pass to 21 etc.
When you gained XP there at level 20, you'd get to level 21, level, attempt to take the level, but it would strip you of most of the xp for that level. then start again.