Hi,
I would be interested in your project.
My first question would be the version of illustrator you're using to run the script?
If I understood you brief right you do not need a script to be created from scratch as you have it already working, you just need it adjusted, right?
May I ask for a copy of the script and the sample files so I can work on it on my end?
Kind regards
pixelke