I never could get pin 4 to work with my simple micro switch filament run-out senor.
So I Opted to use one of the unused End-stop switches I started using using X-Max pin 2 then not too long ago I changed to Z-Max pin 19.
I can not give you my reason for changing at this point though I did have a reason for changing.
Oh! I remembered now. My MPCNC uses both XY Min and XY Max and I wanted as much a possible to be uniform so I changed them all to Z-Max - pin 19
Anyway went off topic for awhile, Though I have used these unused end-stop connections for 3 years thru many Versions of Marlin 1.1.x - Marlin 2.0.x
I change filament run-out in pins_RAMPS.h
#define FIL_RUNOUT_PIN 19
Computer Programmer / Electronics Technician