What is this time machine gag referencing?
This running gag in the Gintama anime is actually from Doraemon. They are referencing to how the entrance to a time machine is available at a hole similar to a drawer, which is exactly where the time machine is in the Doraemon anime. Here is list of the other parodies present in Gintama.  LIST



The drawer entrance to the time machine.