You shouldn't be using IISReset.
IISReset has a
/NOFORCE parameter that waits for the service to shut down cleanly before restarting it.
That might get you around the loss of settings when the service fails to write out the metabase.xml file in time (perhaps due to antivirus interference; it's often something that doesn't reproduce elsewhere when this happens).
But rule-of-thumb, don't use it.
I can't think of any situations other than complete failure of all hosted websites simultaneously in which IISReset might actually be required.
Most of the time, you can get what you need to do done with a Recycle of the relevant Application Pool. Note: It doesn't actually start a new process until the next request comes in, unless requests are queued already.