When looking at inductor circuits I sometimes try to visualise what the complimentary capacitor circuit would look like. In this case that would be a cap between the GPIO and GND. So, for the inductor it would have to be in series with the input.
simulate this circuit – Schematic created using CircuitLab
Figure 1. Complimentary circuits?
My guess is that as the switch closes we have an R-L time delay before the GPIO is pulled low. When the switch opens the inductor will force some current through - giving a micro-arc - until the switch is truly open.
- In the capacitor version the input is pulled low instantly but is slow to release.
- In the inductor version the input is slow to get pulled down but will release instantly.
How does the inductor debounce the push button?
I think I've covered that above.
What is the purpose of the diode here? If it is a flyback diode, ...?
I don't know but there are usually input protection diodes on the GPIO so the one pointing up from GND to the GPIO would suffice to provide the ground return path.
... should it not be connected across the inductor instead so that the inductor can dissipate energy?
No. I think that in this case we want to force an arc.
Maybe someone else can think of a reason for the Schottky diode. I might if I sleep well enough.