This is really cool, if incredibly slow. I have tried to make it more efficient but there are still some horrible nested for loops in there (and the smoothmin function is pretty slow). I have included the option to go for a really low resolution value (down to 1). Values like these can cause Scratch to run VERY slowly (seconds per frame sort of speed). I would recommend running this project in TurboWarp at least if you wanted to see those resolutions. Please let me know if you spot anything I could do to improve performance (be warned - the code is barely readable).
smoothmin function from Sebastian Lague's Ray Marching video (although I think he got it from somewhere else). Everything else me!