Given that everything else in the game is cancellable for free, why do you want just placing building foundations to have a cost.
I prefer Warcraft 3 system in regards to this. In that game:
- All resources are refunded if construction is not started.
- 75% of the resources are refunded, if construction is started but enemy has not attacked it yet.
- If the enemy has damaged the structure, then the percentage damage done by the enemy is not refunded. The minimum of 25% resources lost still applies.
- All structures are unarmoured during construction. This often means that units do about double damage to them.
So if you complete a building 80% and delete it, you get 75% resources back. If you build it 80% and the enemy damages it by 60% of max HP, you only get 40% resources back. The reason I prefer this method is that it punishes castles of Doubt to a lesser extent.