The thing to remember with the ESS is it is very fast.... way faster than the parallel port... so you need to slow things down a little maybe by adding in some debounce on the ESS Config Screen.
You probably need to allow for a delay in your code for the toolchange to allow your solenoid time to activate (the loop within Mach runs at 10Hz, hence it may try to run through your code so fast that your solenoid is not having time to enegise and de-energise.... also what is not helping things is how fast the loop in the ESS can run.
I'd suggest that Item number 1 and 2 can "probably" be corrected by going to the Mach3 >>> Config >> general Configuration tab, and down the right hand side there are a number options for "Pgm End, M30 or Rewind"....
I'd ask Mach3 to e-stop the machine by ticking the checkbox..
And see if that clears your problem.
It may be worth your while to post your XML file here and someone will have a look at it for you and may be able to provide a few useful comments you may wish to use (or not!)
You will need to change its name to something unique or it won't upload.