A script to fade-in an Audio gain when activating a rackspace

The discussion started from this post : Issue with rackspace change

As I encountered the same issue, I decided to find a solution to crossfade from one rackspace to another with 3 conditions:
playing continuously,
with a different sound in each rackspace,
with no level changes.
This is a morphing function.

This annotated image shows the scripted transitions in yellow and the non-scripted in green.

I don’t know GP well enough to say if there is a solution other than the script to achieve this regular level, but in the meantime, this one works fine except for the transition time which I can’t get to work.