The file "models/players/hnt/redneko2.tga" in pak2-players-mature.pk3 is an example of the TGA problem.
Byte 16 in the header is the pixel size, value is 32
Byte 17 in the header contains "attribute size", value is 0 but should be 8
Problem is: quake3 allows this to contain alpha, yet most programs (especially GIMP. also all image viewers on Linux I tried) require the attribute size field to be 8 to support the alpha channel.
Some ideas for the script:
You could test if an image has transparency like this:
1. convert original image to A.PNG
2. convert original image to B.PPM then to B.PNG
3. compare the two png files
(since PPM does not support transparency, the second png will be flattened if the image has any).
You could test and fix the broken tgas just with of linux "dd" and "cmp" commands.
Not sure if you know about the linux "find" and "xargs" commands, they can find all files with a certain extension and run a sub-script on them all, e.g.
find dirname -name "*.wav" | xargs sound_conv.sh