Running taskkill /im "Plex Media Server.exe" (without the /f) flag initiates a graceful shutdown of PMS. Without the /f flag, the process is signaled to close (it appears from my logs that a WM_CLOSE message is sent). Plex then shuts down various functions (network advertisement, plug-ins, tuner service, database connections) and exits.
Including the /f (force) flag forces a shutdown, whether or not it can be performed gracefully. However, without the flag, the application can choose to continue running. So it’s likely that your script would need to take that into account and monitor that the server has stopped before moving on.
Having said this, I’ve not tested during scheduled maintenance, so it might be a good idea to still run this outside those hours.