Impact of delay on pattern formation and stability in the attraction-repulsion model