FFMPEG How to zoom in and then zoom out in one command line

I'm making a video with zoom effects.

I want put in zoom in and then zoom out like beat react effect.

"zoompan=z='if(lte(zoom,1.2),zoom+0.0200,zoom-0.0065)':x='iw/2-(iw/zoom)/2':y='ih/2-(ih/zoom)/2':d=500"

It was my first idea but it just stuck at 1.2 zoom ratio.

I want zoom starts with 1 and then once zoom reached 1.2, then zoom out to 1.0 slowly.

What am i supposed to do?


Use

"zoompan=z='if(lte(mod(on,42),10),zoom+0.0200,zoom-0.0065)':x='iw/2-(iw/zoom)/2':y='ih/2-(ih/zoom)/2':d=500"

In each 42-frame cycle, this will zoom in for first 10 frames, and zoom out the rest.