I'm sure this can be done with scripting, and I think Dave Saunders posted a (better than this) solution to a similar problem a year or so ago. Anyway, here's a down and dirty way, if you have MS Excel . . .
Set up your ID page similar to the way you've done with your certificates, like this on the master page
Text Box 1 [link to] Text Box 2 [link to]
Text Box 3 [link to] Text Box 4 [link to]
Text Box 5 [link to] Text Box 6 [link to]
Note when you are creating these text boxes, that they are only going to contain the serial number.
In Excel, Edit > Fill > Series to make a colum with 1-5000. Copy that column to Column B. Select both columns, copy, and paste into your "little text box" in ID. Search for the tabs in ID (^t) and replace with ^n or ^p to force the text into the next box.
This won't give you leading zeros, but you can probably set those in Excel, too, or do a quick series of search and replaces in ID.