I don't think you can prevent the spike. Once you disturb the sand, you're stirring up everything it contains.
2 nights ago, one of my fish decided to dig a bed in the sand all the way down to the glass in one corner. The nitrates spiked really high for 24 hours, though the ammonia only went up slightly.
Perhaps it would be better just to replace the sand with new?