I think he is meaning that if he goes to say the Forge, and upgrades armor, the armor cost is set to 100 minerals, he upgrades, but gets a 100 mineral refund.
I don't think there is such a condition that can monitor upgrades.
If Custom score were to be the way to go, how would you define a trigger so that upgrades would be converted to Custom Value?
Since the refund concept makes the upgrades free, I'd recommend making them free.
If your looking to set some sort of limitation on when they can upgraded, I can imagine some different approaches.
But it would depend on what your doing in the map as to what could be done.
Such as the player gets a certain amount of kills, he gets a civilian in a protected area.
Take the civilian to a location that would designate getting an upgrade.
The civilian is removed giving you 100 Gas.
The cost of an upgrade is 100 Gas.
Have other locations for different credits.
1 for 100 minerals to buy something else.
1 for a hero, or many for different heros.
Again it depends on your map, and also how labor intensive you want to make it for the players, to get the bonus, or upgrade.