Welcome to Android Central! Funny enough, we usually get posts here asking for then notification tones to sound when the user is actively using the messaging app, not the other way around!
When you say “default text app”, are you talking about Google Messages or Samsung Messages? Or are you using some other 3rd party messaging app that you set as default?
I also moved this from the Galaxy Fold forum (for the 1st gen) to the Z Fold4 forum.