Not really a script...I did it pretty manually. From my top-level video folder I ran:
dir /b /s *.m* > audio-codecs.bat
which got all my video file names into a batch file. Then I edited the file so each line was replaced with two lines like this:
echo "MyMovie1.mp4" >> audio-codecs.txt
ffprobe -v error -select_streams a:0 -of default=noprint_wrappers=1 -show_entries stream=profile "MyMovie1.mp4" >> audio-codecs.txt
Then I could see in audio-codecs.txt which files were HE-AAC. I wrote my own Windows wrapper utility for converting video files using ffmpeg, but essentially I ran this on each file (I only needed to convert 3 or 4):
ffmpeg -hide_banner -loglevel error -nostats -i "MyVideo1.mp4" -y -acodec aac -b:a 224k -vcodec copy "MyVideo1.mp4-audiofix.mp4"
I only use a stereo setup and the above was fine for my needs, but adjust the audio encoding to your liking.