I haven't done this in R yet, but I have done it in the past, block and varied block size randomization in SAS. Where code is available online if you want to rewrite it into R. I would be interested to see if you find a relevant package - which it would be difficult to imagine a package doesn't exist.
Thank.