An attack on the mining difficulty algorithm does not imply violation of the typical security properties of a cryptographic hash function*.
Assume someone discovers a method which makes it far easier to discover new blocks, this method: may or may not be implementable by the current SHA256 ASIC hardware.
1. If it is usable by the mining hardware, then there will be brief period of overproduction and then difficulty will adjust. If the attack is so bad that difficulty can't scale and we run out of a leading zero's, then the SHA256 collision resistance is broken and we have bigger problems. Under this scenario, everyone would see the need to immediately switch to new hardware as people could create cycles and irreconcilable forks in the block chain
2. If the attack is not usable by the mining hardware, then the miners will need to switch to new ASICs anyways and the hash function can be changed without resistance.
But lets ignore all that and say, for some unspecified reason, the bitcoin community wants to switch hash functions and has some lead time to do so. One could require that miners find two blocks, one computed using SHA256 and one computed using the new hash function. We could then slowly shift the difficulty from SHA256 to the new hash function. This would allow miners a semi-predicable roadmap to switch their infrastructure away from SHA256.
* It would be a distinguisher which would be bad, but collision resistance could be merely weakened.