hey there @klaasnienhuis
I never solved a manner to make unused textures persist like you have because my tool is a viewer run time tool , but I did edit my utility to cache all scene textures that are already in the scene and loaded. My edits are not live yet , still in dev mode locally as there are some usability issues i discovered with removing textures from objects loaded with the scene.
Anyway before I only factored in new uploaded textures into the caching system i have running. Now I made it so the scene textures that are loaded with the scene are pushed into the cache as well, they just use the texture name minus the extension as the object key. For runtime uploaded image usage I actually avoid using the texture url as the key as it could be some super long base 64 dataurl or svg url etc, so I promote user created keys as an argument when adding/ using textures via the utility. So its only for scene textures that the key is automatically assigned.
So now it is possible to target those textures and assign them to other materials , I explained to the user that unused textures get stripped , they understood that and were happy with your hidden system ( very crafty by the way ), just that my utility did not factor scene textures into its usage at all , something i overlooked as the need never arose personally, now it does do this so all is sorted.
For the bug , I found out you cant remove a texture from a scene object that loaded with one already assigned because the scene graph api strips the color property when there is a texture , and if you remove the texture then it has no color or texture info and bombs out. To get around this i just created a hack to set the create the color before removing the texture. This works ( although there are still unwanted warnings in the console ) but since I dont like the hack im waiting for some fix from sketchfab and then I can remove the hack and I will make my changes for scene texture usage live.