Hello @SawFan1412
It might be difficult (and tedious!) to write a script each time icon sprites are used.
However, what you can do is change the sizes of the sprites you have. A script can be written to change the sizes of sprites theirselves. In order to do so, you could do with knowing the sizes of the Gen 9 sprites. It is possible to write a script to go through every sprite in the icons folder, and then alter the sprites.
However, I am not sure as to how you acquired Gen 9 icon sprites that are a different size to the rest of them. The ones in the Gen 9 Pack are the exact same size as the rest of them
Hope this helps, and if not, let me know the size of the Gen 9 sprites, and I can walk you through a more precise script
Swdfm