Multipurpose momentary button - microcontroller/arduino/esp8266
Yes, this is possible. 


Use the long-hold to put the processor into sleep state. 
Configure the same pin to wake from sleep.
While the processor is running you can use the pin as a standard input.