This is kind of similar to a youtube video I have on my Youtube channel.
Try looking at this to see if it gives you any ideas: Youtube Video
You probably need to include a find to only find the items that need to be reinvoiced. But that can easily be added.
I've used your solution partly for this and it works fine, first i did a line by line conversion, but after your video i set it up that i select the lines to convert and make the invoice at once !!! much more stable and reliable