Figured it out and published a new version :) Have fun! I did not test all cases yet by the way. Using signals might be broken, if you encounter any errors please post them!
Thanks for the tip! I fixed that, signals were also broken, and the counter chest after a void-belt was also broken. Fixed all of that. Let me know if you encounter any other issue
Your script create items with only name. As quality is not defined it's always will be a normal item.
I found that can read the original item quality: inventory[1].quality and create the clone item: {name = belt.item; quality = belt.quality}
With this solution there is a bug, if you pick out the item from the chest, getting an exception that can't get the name. Somehow the chest item is 0x with name and quality is null. First I tried it in the same way but my lua knowledge not strong enough to understand why is behaves like that.
I gave up and made a workaround, keep your method to give back the item name, and cloned it for quality.
belt.item = get_chest_item(chest); //for name
belt.quality = get_chest_item_quality(chest); //for quality