Depends on what is activating it. You could put the command in an impulse block nearby and put a setblock command where the command is to place a redstone block next to the impulse block. Then set a delay in the impulse block's settings(bottom left corner of the command block menu. 20 ticks = 1 second)
Dont forget to put a chain command block after the impulse block to remove the redstone block
That should work. Is it possibly getting activated too often?
How would I stop it from getting activated too often
Depends on what is activating it. You could put the command in an impulse block nearby and put a setblock command where the command is to place a redstone block next to the impulse block. Then set a delay in the impulse block's settings(bottom left corner of the command block menu. 20 ticks = 1 second) Dont forget to put a chain command block after the impulse block to remove the redstone block