You could always edit your G-code in Notepad to replace every M5 with a M5 G4 P2 (assuming that your machine doesn't require them to be on separate lines). But the better way would be to edit your postprocessor to do that automatically at the end of each machining cycle.