Having Trouble combining two codes that work separate from each other

sorta ledpin is the red led that is the one letting you know that the alarm is active and ledpin2 green led is the all clear. so as far as the delay set it () and that should help the laggyness??