Disclaimer; I have no idea how to do this.
That said, there's two issues here (both complicated) that need solving. The first is the creation of the curve itself, the second is the alternating under/over pattern. Depending on the type of output you desire (image? geometry? closed 2D inking regions?) this second problem will require different types of solutions.
As for the shape itself (and let’s ignore the four disjoint scribbles at the corners) one would obviously have to start with the fact that it has rotational symmetry. It seems to consist of four concentric layers, each with the same number of repetitions around the circle. This at least means you only have to define a single element and then polar-array it.
Which leads us to the real problem; how to define this curve element? Barring neural nets, you cannot just tell the computer “make a looping curve like this image here”, you’re going to have to actually make all the decisions yourself. Ideally you can make them in the most efficient manner (which excludes manual modeling, and also the even more cumbersome Grasshopper approach of stringing together Arc and Line components). Some sort of notation is clearly called for which is both readable to humans and translatable into a collection of successive lines and arcs.
It seems to me this notation needs to work in polar coordinates, otherwise you’ll never get your elements to connect while rotating them. The standard approach to this would be to adopt a
LineTo/ArcTo/CurveTo approach common in drawing apis. But how many different commands you want to implement and how you are going to actually convert a piece of text containing command into geometry* sounds like a month of your life.
* It’s going to take a lot of custom code this way, that much is for sure.