Although I suggest that you use my last code, here are 2 lisps developed further more, but with many lacks...
Picking version is correct, but it is totally unnecessary, as you can pick entities and you'll have them griped and without routine...
Pick version is longest developed, it asks for starting lower-left piece, result correct and for *-MR5.dwg...
Both codes are time consuming, but who likes it to see them testing here they are... See attachment...
M.R.