Hi
Simple: create a special folder, same as the /var/run used for PIDs, and create files containing the username and having the timestamp of when the PC was WOLed on. That would give a second script enough info to turn off the PC and clean the PID file out of that directory.
There are samples on the 'net where a script can shut down a linux or windows pc.
example for windows (on windows):
shutdown -s -f -m \\srv001 -C "This is a TEST-Shutdown" -t 25
TIP:
Windows 10 comes with a SSH server. Autostart, and SSH Key auth are your friends…
Linux logs in remotely, calls the script, wait for finish (and return data/parameter) logs out, all without any password or interaction.
My 2 cents
Andy