Neat! Snow Leopard is the Mac equivalent of XP (despite being contemporary with 7; both saw their initial RTM releases in mid 2009). Does this work with 45 as well, or is it limited to 38?
For late-model PowerPC Macs (Most fast G4s and all G5s), you want to target TenFourFox, whose latest version is forked from Firefox 45 (it lost source parity I think a couple years ago because there were some things that simply weren't portable). I think your script will be very helpful for that, as TFF is fairly decent, but it's configured as one-size-fits-most, so it could use some extra optimization, particularly on faster machines, to reach its full potential (it's extremely good as is, though!)
If you could also try testing your script with ArcticFox, that would be useful too, as that is supposed to be a fork of Pale Moon (akin to Roytam1's New Moon, but for early Intel Macs), and thus should be more or less compatible with your script as is, but should be tested for any Mac-specific peculiarities. I can try it out on my Mac, if you like, as I have ArcticFox installed on it.
Let's keep up the good work!!
c