It uses the same techniques and concept to a large degree. The math is a bit different, but you need loops for raymarching as well. Functions you can also make and call as you see fit. The way you did it is indeed not too beautiful, but it also not required. You could just write the loops yourself inside a custom node, if you dont want to import the script through a hack, as you put it.
I have made a SDF renderer in OenGL before, and I have done raytracing and raymarching in UE4. The editor sucks, but it is workable. I just made changes in another editor and copied the result in.
Good work, btw. Really nice and smooth results.