You could use the "Charge Gold and Lumber"-ability in combination with the Chaos-ability for this (though I've never used Chaos on buildings, it seems to be working correctly at first sight).
"Charge Gold and Lumber" will mimic the upgrade and when the ability is cast, you add "Chaos", which will transform the wall into the Secret Wall.
Because the ability ("Charge Gold and Lumber") can be added/removed at any point in time, you can change when it appears as an upgrade.
The downside is that the ability is instant (there won't be an upgrade timer).
Another downside is that the ability has to be given manually to every wall (so when a wall is upgraded, you need to check whether it's the wall that's currently set as 'the one that can be upgraded to a secret wall' and then give it the ability).
I can't think of any, but there might be better ways to achieve this.