Instead of just inverting the phase of the input and outputting that, you could analyse the input for high energy frequencies and then generate the phase inverted output based on that. If you took a decent sized sample window you'd avoid the noise cancellation doing anything to sudden, short...