I'm a little out of my wheelhouse though. Maybe that would only work for HTTP which will not cover Time Machine?
Does Time Machine run on a schedule? Add a cron job (whatever the Mac equivalent is) to send a WoL ~1min beforehand?
I believe on x86 the BIOS supports setting a timer for self-wakeup. The OS can tell the BIOS "I'm going to sleep. Pull me out of sleep if the RTC passes this datetime."
Depending on what Pi you're using, it's networking is over USB, and so is quite performance constrained.
The traffic could be coming in via your WAN connection and your router is just going to forward it to an IP.
I guess you could just attach an external HDD to the Pi. Thats worked for me before.
[0] https://forums.unraid.net/topic/6455-how-to-wake-on-arp-unra...
I'm not sure how Plex clients would handle it, but putting an nginx server with the same certificates and just returning HTTP 429 (Too Fast) or 500's and a "Please try again in 1 minute" response, along with sending the magic packet would work great for most HTTP based things.
I wonder if you could make the 'wake up' a bit more advanced.
Run tcpdump or something similar on the Pi, with a filter set for inbound packets to the media server on ports that Plex or Time Machine uses. If it sees those packets, send the WoL magic packet.
This might not work if your switch does proper port isolation - but you could perhaps add port mirroring or something like that.