Dear Pat,
Thank you for your query.
Congratulations on implementing what you already have.
That sounds quite impressive.
I cannot say much more than agree with the direction you suggest, checking the existence of a detail group before it is copied and ensure it gets inserted in the proper location in the new view.
I hope this helps.
Maybe you are already done by now?
Good luck!
Best regards,
Jeremy