I've noticed that the gold cost to hurry a building does not go down if the building is nearly complete, as it did in most previous versions of Civilization. If I've built 90% of a city wall (or whatever), but I spend the cash because I need it now, do I get anything back in compensation for all that production time?
As Jason Berkan said, there is no 'hurrying' with gold as such in Civ V, its only purchasing.
The answer is no, you don't get anything back for any number of hammers you have accumulated if you purchase the building. So even if your Wall is only one turn away from completion, and you purchase it, all your accumulated production is lost.