Thank you for your reply, thorsnuts.
There are many ways; it always depends on what is given.
As mentioned, this is a technique I have shared for around two decades, often used for rollercoaster simulation (parks) or racetracks. With User Data and relative referencing, this tag can be used in many cases without even opening the XPresso editor. To reply to your script idea.
Here is an Alternative
CV4_2025_drs_25_MGtn_01.c4d
Sometimes, the Surface Deformer works best.
Enjoy your weekend