As hoffmajf noted, the original script doesn’t work anymore (because it requires a “X-Plex-Token” API token to call). I’ve put a full walkthrough of how I’ve gotten this working over here:
https://forums.plex.tv/t/how-i-got-my-plex-linux-computer-working-with-suspend-sleep-after-inactivity-and-wake-on-lan/341703
Hope this helps!