looks quite nice already!
for achieving a more irregular look, why don't you try tripling the other variables too, like you did with r? (l, g, s, n, x, y, r)
then you would have 3 sets of lines with different thickness speed, length, gap and all..
if you want even more sets, or a variable number of sets you should use an array for each of those variables.
I think I'll only be able to figure this out when I figure out your formulas in this code like the "x = ((x + s) % (l+g)) - (l+g);"
this sets the x position for one string of lines (line gap line gap line gap).
x =
it adds the speed s to the old position, so the whole line moves to the right (you can also try a negative number for the speed).
x = x + s
now we divide the result by (l+g) which is the length of one line segment and the gap and use only the remainder. (look up the modulo operator % for more information how this works)
so actually the whole line is moved at max (l+g) to the right, because then it looks the same as if it wasn't moved at all so it is set back to zero again.
x = (x + s) % (l + g)
finally offset the whole thing to the left by one line segment (+ gap), so we don't see emptiness coming in as we move the line to the right.
x = (x + s) % (l + g) - (l + g)