OK, so you are testing the impact of short sags on pieces of electrical/electronic equipment. You probably know what you are looking for as far as disturbances in the equipment.
What you want to know is how to generate arbitrarily short sags in AC line voltage. Yes?
How much power? What voltage? What about spikes?
I'm inclined to suggest building a PWM controlled inverter, if the power isn't too high. With a high enough PWM and carefully designed filtering, you should be able to filter out effectively all of the PWM switching artifacts while leaving the filtering able to allow dropouts and sags through.