Im quite new to expressions so don’t quite take my word for this. But I think what you want to do is just copy and paste the animation, then use a sequencer script to separate each photo by four and a half seconds.
Or if it is one paramater that you are editing, you should use a sinusoidal (sin or cos) function and limit the values with a if/else statement, for when the images are still for four seconds. Again, I am new to expressions, and Im a little unclear on how many/ what paramaters you are working with.