No, they won't learn to stay on their side. Betta just aren't capable of learning those sorts of things. if they're 2 months old, they'll eat any new babies you breed.
It doesn't matter what male is in there. Baby fish need to be away from adult fish. And those 20 fish you have are going to start attacking each other soon enough, you need to jar the aggressive ones soon.
And I say again... 20 baby fish still need more then 5 gallons. You should let them have the whole 10 gallon tank til they are old enough to go to another home. and not attempt breeding again til you have more tanks and more heaters. Breeding bettas is a lot of money and time, it's a huge investment with little payout. You should go looking through the forums for more information. I may be wrong, but I don't think you're ready to breed, and the 20 babies you have now might suffer for that, not to mention the adults you're talking about breeding.