Hello.
I don’t think it is reasonable to expect someone to write exactly the code to do what you are describing. You try starting with the code for Arduino in this guide.
Yes, enable lets you turn on and off the output FETs, so that is what you want for saving a little power when you don’t need holding torque. A very detailed description of the driver is available in the A4988 datasheet.
- Ryan