When does it happen?
Seems to be on - or after a spell on - the ground, that this type of explosion has occurred. Maybe there wasn't a spark at all.
After the tank empties in flight there is much less chance of an environmental overheat (although I did collect a HP Victor from a check in St Athan once and had blisters on the bomb bay tank afterwards from a loose hot air duct...)
Why not then start with a ground based system to fill intentionally empty tanks with nitrogen after landing?
This could involve a nitrogen truck and the mod would be addition of a (Schrader) valve and a bit of tubing to the tank. In this way much of the engineering work and costs might be saved.