There’s always regex! 
It looks as though you could split the string on whitespace + open bracket to have separate strings for each layer. Then write functions to read each type of layer. Not a particularly quick or clean solution though…
I don’t work with sequential models much, but is this basically the syntax you’d use to define one? If so, to make a new model with this setting you could just run mymodel = eval(mystring)