Hi,
I think that there is no need for such approach that you write. This can all can be implemented in script without create new illustrator file, delete layers and similar....
Generally I usually use Javascript for this, it run in back so it will be good for speed. I will send you detail explanation how to use that javascript file and how to made some changes in the code if you want to do that. I assume that you already have experience with this kind of work. And if you are not do not worry you only need to upload javascript in Illustrator and I run and for that u need a few seconds and couple of mouse clicks, after that script will run and u can do something more creative..
I have an experience of over seven years of work in Photoshop, Illustrator, InDesign, Acrobate, Adobe Lightroom, Presentations, Microsoft Office(PowerPoint,..),, also JavaScript associated with Adobe app, Python, Perl ... I am a very dedicated and diligent, so you can expect top quality.
Best regards,
Bojan