Crochet Code almost working

Hey everyone!
I am an archi student and trying to design with crochet and hyperbolic surfaces. I am writing a code that should give me crochet instructions, it basically works but only on each crochet line independently. I am trying to get the directions for all the rows together and get the color coding for each kind of stitch on the entre model too.
This file has the code that works on each line individually at the top, and the unorganized part is my effort to get the instructions all together. Also there are other efforts turned off but I don’t think they are relevant.
good file.gh (100.8 KB)

Thank You!!!