Have a Sim sleep. Then, have another Sim sleep. Make sure they are in separate beds. Then, go into buy mode and enable the move_objects on code. Lift up a Sim and put it on the other Sim's bed. The other Sim will wake up. Next, put the Sim to sleep on where the other Sim's bed (who is still sleeping). Then have the Sim who is still sleeping wake up. If done correctly, the Sims should be stacked on top of one another.