Thanks for playing!
That level has a lot of history, strangely enough. A very similar level is in one of my previous games (Super Box Bot's Package Push). Both of them come from a fractal pattern I started drawing just for fun maybe 7 years ago. Funnily enough, it took me a few years before I sat down and figured out how to algorithmically represent that fractal, despite a couple of failed attempts! It is kind of a tricky pattern.
Anyways, I took a screenshot of the solution and uploaded it to imgur here.
If you want a hint, though, here's what I could say: start with a small piece of code that gets around the first U-shaped bend, and then see what would be necessary to repeat that process around all 3 bends.