You could get a list of the layer names from one viewport through code, but you would have to use the command 'vplayer' to freeze them in the one you are matching to. You can't use 'entmod' on a viewport.
Side note: You might be able to do it with ActiveX controls, haven't tried yet, but you can change some items with ActiveX, so this might be one. Just throwing that out there.
I just use the "match properties" button after I get one viewport the way I want it.
But if this works, no need for code.