I'm not entirely sure of what's your positive reason for reusing variables, though. I find Francisco's current solution reasonable. I had a few comments on some specific details, but the general architecture makes sense. I'd say that native behavior makes it rather natural to think a SM1-3 sampler as, secretly, a SM4 sampler plus a resource, so the transformation Francisco is introducing doesn't look hacky. OTOH using the same variable object for two different things doesn't feel very natural. I'm sure it can be made to work, but I see little value in reconsidering previous design choices for what doesn't really look like an enhancement in itself. Could you please explain what you like of your proposal?
Without having tried it, it just seems simple and like it makes sense. The old code isn't complex either (well, until it starts needing to handle struct/array types) but it seems like it should be even simpler to do it this way. There's no need to add synthetic variables (and hence no internal flags to mark them as different from the other variables).
It also lines up with my preconceived notion of how sm3 int/bool constants would work. Again, they don't actually have to work that way, but I feel like it makes a lot of sense.