Ideas to consider if you are stuck:
Start by assuming at most one overlay per slide. [As a more general principle, do you understand why I'm making this suggestion?]
In the version without overlays, each slide body is restricted to containing one body element. Is that reasonable once we have overlays?
The existing print-slide function knows how to handle slides without overlays. Can you find a way to reuse this function (without editing it) to display overlays? Could you do this if you had only one overlay?.