this is more and more looking like my life's work
I think this all depends on how the data is presented is your csv list. Normally a clamp is shown as {clamp GP clamp} so it would be possible to change that to [clamp GP GP clamp} to handle your second image. But for your first image... i dunno... you would have to introduce a new type of clamp because when routine reads {clamp} it goes into special mode and keeps on reading until the word clamp appears again and treats it as one unit. So the entire symbol would have to consist of a horizontal clamp plus a vertical clamp with a bottom and a right GP , all in one special symbol. Current routine can't handle snake within a snake.
As for the overlapping , I updated attributes to mtext attributes previously but I think it probably needs a space to start a new line. Else you need (as I used before) attribute with type 'fit' and that will work but short names will get stretched out and that also doesn't look pretty.
I don't think its realistic that routine will ever be able to handle every situation you throw at it , human intervention will always be needed (if it could handle everything you would be out of a job...)