In theory that could work, but I don't know how easy it would be with
the pysam API. One critical issue is the list of references must match
between the two BAM files if you hope to transfer entries from one
to the other (when mapped to a reference the reference is stored
as an integer citing the reference list). If not, you may have to
update the reference numbers.
I think the simplest solution is to output two BAM files and
call 'samtools merge' to do the hard work.
Peter