Arduino/Atmega328: check if PIN is shorted to GND
Is it really simple as


Almost:


you need one code change (as kindly mentioned in comments by Peter Bennett and next-hack while I was writing this)
Atmel recommend (see link below) that you add at least one decoupling capacitor between Vcc and Gnd, and an RC combination on the Reset pin, to help prevent spurious resets when relying on the internal pull-up alone in electrically noisy environments (a classic trigger is nearby relays operating). If you decided to change the design so that the Reset pin is driven by anything external, then a diode from the Reset pin to Vcc is also recommended.



  1) Configure the PIN as INPUT_PULLUP?


Yes, you can do this whether or not you also add an external pull-up resistor.


  2) Check if PIN is HIGH then is connected and do stuff?


Almost. The pin state to check for, is the pin being LOW with the jumper installed, so your code needs to be changed for that.


  3) Do I need external resistor (and what value) or is it sufficient the INTERNAL_PULLUP?


From experience, I would consider adding an external pull-up resistor for the jumper pin input (e.g. 10k), especially if anything causing an electric field (e.g. fingers, nearby relays etc.) could come close to it, as the internal pull-up resistors are relatively weak. Other people with different experience may disagree that this is needed.

If you choose not to add an external pull-up resistor on that input pin, then you must enable its internal pull-up resistor.


  4) Can I leave the PIN shorted to GND for a massive amount of time, let's say for 1 year? This atmega will be on "forever"


Yes, that is fine. There will be some power consumed through the pull-up resistor (whether internal or external) and that jumper.

There are other techniques that you could use to reduce power consumption e.g. sleeping, then waking every 100ms, checking the pin state, then sleeping again, if power consumption is a concern.

See:


Atmel / Microchip Application Note AN2519 regarding reset &amp; decoupling recommendations
What is the minimal set of parts for a circuit with this AVR microcontroller?


for more information about "minimal" ATmega circuits.