OK we can have a think then how to add nested blocks to the routine,
I think there are a couple of if statements in there, one 'if' for outside of a block to change the line type,s one 'if' for inside a block to change the line type, it might be just as simple as looping through the nested blocks from there to change the line types
I'll have a think later