Sketch name as PreProcessor value?

eried:
If you don't remember the sketch name, and you have to connect it to the PC to check, what is the point of doing this? If the board is already connected and the IDE opened should take couple of seconds to upload any script

I think it is more an exercise in version control. Coming back to a device that has been in use for some time and trying to determine exactly which version of the program it has on it currently can be tricky, unless you have an extremely good memory or are organised to keep meticulous records.

Or automatically write some key info into the sketch itself, as this is doing.

Edit: I recall seeing a write-up a few months ago on a website a fellow has set-up to use as a "repository" of sketches, with a serial number system of some sort that ties an Arduino to a particular sketch. I had a quick look but can't remember enough of the details to find it... I seem to recall his motivation was to address the problem "orphan" devices that had lost their source code over time.