You can just make a common event that checks if the player shares a position with a common terrain tag, then just have it play the sfx and have a small wait as a delay so it doesnt keep repeating. That way there's no need for any squares. With 8 terrain tags this limits you to 8 different sfx but you could have a one seperate event for each map so on map 1 terrain tag = water and on map 2 terrain tag = rustling leaves and so forth.
I knw you were asking for a script but I was just demonstrating that you don't need to copy and paste events to include this feature.
Though to make a good script of it, I'd recmoomend being able to set GLOBAL sfx for terrain tags 1 to 8, and then be able to state specific map names after that where you could have different sfx for terrain tags. So if you don't bother including a specified map, it will just follow the rules of the global sfx.