I am not too sure about your requirement but maybe the attached plugin Slideshow.py will go part of the way there.
Unzip. Put in your User plug-ins folder.
Find it in the Animation menu. One option is a fade from top layer to bottom layer. I did check layer opacities and it is a linear fade.
Obviously for a fade-back-in reverse the layer order, save and re-open as layers over the (original) image.
https://i.postimg.cc/L8Mpv3FX/temp.webp
Unzip. Put in your User plug-ins folder.
Find it in the Animation menu. One option is a fade from top layer to bottom layer. I did check layer opacities and it is a linear fade.
Obviously for a fade-back-in reverse the layer order, save and re-open as layers over the (original) image.
https://i.postimg.cc/L8Mpv3FX/temp.webp