Has anything changed recently, e.g. an app update? If an app's behaviour changes like this that must mean that either the app itself has changed or one of its settings has.
The SMS app I use (Textra) has a setting to choose whether to make a sound when messages are received during a conversation or not. I don't know what app you are using (I'm guessing it will be Samsung's default app, which I have never used), so don't know whether it has an equivalent setting, but I would check the app's settings to see whether there is any option like that. If there isn't then using a different SMS app which does have such a setting is the simple solution - your SMS and MMS messages are stored in a system database rather than the message app itself, so you can swap apps any time and the new app have access to all of your messages. However it is trickier if you use the Samsung app's "chat" service since few message apps support that - if you do use that but decide you want to try a different app look for one that supports "RCS" (the technical name for "chat").