Command to recreate per lane bam from a merged bam

Refer to AT-658, this command tool is needed to recreate per lane bam from a merged bam. The steps involved are: extract read group bam, compare flagstat, revert markdup tag, reheader bam, create bam index, create bam md5, move outputs over.
I would write the documentation as describing what the tool does rather than what it needs to do.  For instance:

'A tool to create a per-lane aligned BAM from a source merged BAM.  The new BAM will be reheadered and have any duplicate marking reverted.'

Is the flagstat checking something the user needs to be concerned about, or is it internal to the function of the tool?  I am somewhat confused reading this which two BAMs will have their flagstats compared.