This quote is referring to the creative process of coming up with humorous ideas. To visualize this process, the person imagines life as a set of twigs. Whenever they come up with an idea or situation in life, they imagine throwing it into their head. This is like putting the twigs into the machine. Then, when they come up with a humorous thought or idea about that situation, it’s as if the machine has spit out the twigs, making them into something new and funny. In this way, the person is using their head as a machine for coming up with funny ideas about life.