Call PopUpManager.addPopUp in back-to-front order.
It won't work. The pop-ups are instances of TitleWindow. The user can rearrange them by clicking and dragging. As a result the order in which I've added the pop-ups often doesn't match the z-order.
Oh, I thought you knew how to save it. You would use the systemManager.rawChildren to get all top-level windows, test if they are a popup, and save the order at that time.