Coherent control of time delay and localized electromagnetic modes in active and passive one-dimensional photonic band gaps