Something like this would work using the trigger volumes,
*The red line is your spline, the blue and red would be the trigger volumes. ( blue volume would be the length of the back platform so if Sonic jumped while in front of the platform it he would offset backwards.)
*When sonic enters the trigger volume he would than offset.
*Inside each trigger volume's options you would need to enter speed amount and distance. 0 speed would be instantaneous and something higher would be a slower depth change.
(a custom trigger volume class would need to be created for this)
Edit: you could do it with 1 volume as well, if sonic enters the volume he moves depth 1 direction, and at the exit he could move depth another direction. ( would require more options in the end, like left side amount and right side amount for example. or disable depth change per side)
For the loops you could use the spline path to follow it around depth wise. and if sonic jumps inside the loop's center than the trigger volumes can catch him and push him forward or backwards depth wise relative to which part of the loop he is on.
Although the loop could be done completely with a set of trigger volumes and no spline too. lol
I picked ghz as my level for Xak to test and tweak physics in because of 2 reasons:
*depth transitions in Greenhill zone has the most depth transitions of any of the classics. while sonic 3's angel island only uses it for the loop and the tree tube.
* GHZ has the most complex ground Collisions in any of the Classic Sonic levels. ( it uses a lot of micro bumps that have physics, while other Sonic games don't really use them with physics)
all the offsets used in GHZ. it was a real chore!