There are script commands to stop current sounds and music and play something else. One approach you could try would be defining your custom track in a UTS (see one of the vanilla modules for an example, under Blueprint, Sound in KTool). Then in your encounter you'd need to fire the script through dialogue or a trigger perhaps. Something like:
void main() {
object oEbMusic = GetObjectByTag("UTS_TAG_HERE", 0);
MusicBackgroundStop(GetArea(GetFirstPC()));
AmbientSoundStop(GetArea(GetFirstPC())); // This is optional, depending on the area.
DelayCommand(0.5, SoundObjectPlay(oEbMusic));
}
Then you'd need a second script at the end to restart the original music/sound. If it's a cutscene, you could fire that script through dialogue again. If it's just a straight combat encounter, perhaps through the OnDeath script of the creature (someone more experienced with such things would need to chime in about that).
void main() {
object oEbMusic = GetObjectByTag("UTS_TAG_HERE", 0);
SoundObjectStop(oEbMusic);
DelayCommand(0.5, AmbientSoundPlay(GetArea(GetFirstPC()))); //Only if you stopped it in the first script
DelayCommand(0.5, MusicBackgroundPlay(GetArea(GetFirstPC())));
}