cPanel sets up accounts like /home/username/public_html and if you have an add-on domain it uses /home/username/public_html/addondomain.com. One option might be to create one master account in WHM with 50 add-on domains. The only problem is....
The fact that the original server has its home directories set up like /var/www/domain.com/htdocs would make it hard to just zip the whole lot and unzip it. It would be easier if the directories were /var/www/domain.com (without the htdocs folder).
I take it the original server doesn not use cPanel/WHM because then it would be very simple to transfer accounts from one server to the other.
I think your way with the script works theoretically. I can't think of any reason off the top of my head why it wouldn't.