Okay. Let's look again at the idea of a script to kill and restart the software. Once you have a script working that can kill the software on demand, and start the software on demand. move the script to a GPP.
Use GPP (Group Policy Preferences) to create scheduled tasks that uses the "On workstation lock" and "On workstation unlock" event to trigger your script.