What's the reason for using a wave function?
If I understand your goals correctly, a better approach will be to, on a button press say, store the current time + your delay in a
shift register, and compare the stored value to the current time every iteration. Then, you can put your deferred action into a case structure and process it there.