What you have now, as you have seen, is allocate points for the top 10, 1 point apart. What you can do, assuming that you keep the same point structure no matter how many play, is this:
switch(r, 1, 20, 2, 18, 3, 15, 4, 13, 5, 12, 6, 11, 7, 10, 8, 9, 9, 8, 10, 7, 11, 6, 12, 5, 13, 4, 14, 3, 15, 2, 16, 1)
OR, you could get a little more complex...
if(r <=16, 17-r) + switch(r, 1, 5, 2, 3, 1)
This second one awards a max of 16 points based upon their rank, plus 1, 3, or 5 bonus points for finishing 3rd, 2nd, or 1st, respectively. Either one should suit what you're looking to do. If not, holler back, and we'll help you out more