@gcorthey As @dc42 said:
configure the extruder motor as both an extruder and an extra axis, so that you can command it like an axis with an endstop
eg
M584 X0 Y1 Z2 U3 E3 P3
This defines driver 3 as an axis (U) and as an extruder. You need to add values for U to M350, M92 M566, M203, M201 and M906. Probably best to copy the values for the U axis from the E axis. Add an M574 line for the endstop on the U axis, eg M574 U1 S1 P"io5.in" to config.g
When you need to use the U axis, send M584 P4 to show the U axis, home it, then hide it again with M584 P3.
It is probably better to start a new thread than resurrect a thread that is over 2 years old!
Ian