But I obviously do not want the new music to play on top of the currently played game music but to temporarily replace it. Then, when my custom music piece is over I would like the standard music loop of the game to carry on.
All that really does is flatten the UI sound channels, it doesn't do anything to music and sounds queued up in C code. I'd suggest using PlayMusic(), which does replace the in-game music, but it plays whatever you give it in a loop. You can use StopMusic() to have the game resume playing its own.