That safeguard might be going down the rabbit hole to cover various edge cases, some of which you may not think about. Ultimately you’re going to block the user from doing something they want or ask them to resolve that conflict (or leave them with an SD card that is broken or has issues.
You could implement some simple conflict resolution strategy: “I’m sorry Dave, the inserted SD card duplicates midi PC numbers. Unless you eject and open the pod bay doors, I’m going to prefer the PC numbers on the SD card over the ones on the internal storage”. If you do thism you avoid the need to go down the rabbit hole.
It’s a simple preference that most users won’t care about, but will give those affected a guaranteed way of
working with this. Bonus points for letting hr user choose the precedence of SD over Internal (or vice versa), but that might be one preference too many.
I can see some benefits to this approach as well. I can have multiple versions of a song that responds to midi PC depending upon the SD card being inserted or not. Lots of possible uses for this. Of course it’s not much different than having multiple SD cards.