It's always better when you provide a sample models and explain what you want to do with them.
I believe you can try Simulink.SubSystem.copyContentsToBlockDiagram or Simulink.BlockDiagram.copyContentsToSubsystem.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!