Generally, when you have to start working around your own features, you know you’ve left the barn. I think a better solution is to retain immutability as a feature of Ethereum.
But just to see if I understand what you’re saying, you would submit something like a hash with every transaction and if the source code doesn’t match that hash you revert? I would like that solution if it could also account for linked contract addresses (which is a matter of state, not source code). If you could verify the contract source hasn’t changed and the linked libs haven’t changed, I could see that being a decent feature.