Send Wake on Lan (WoL) request manually through the ethernet cable using an Arduino or Raspberry Pi

As you wrote, a WoL magic packet (frame) contains the sequence anywhere in its data stream.

Usually, the WoL packet is sent using a higher-layer protocol since it's easier to do. Simply send a UDP packet (any port is possible, 0, 7 or 9 is customary) containing the sequence to broadcast address 255.255.255.255.

Good luck on encoding the Ethernet stream though - it's not as simple as RS422/423.

Before line encoding you need to build an Ethernet frame preceded by the preamble/SOF sequence, then the frame header (use Ethertype 0x0842) followed by the magic pattern. Depending on the WoL mechanism, you'll probably need to pad the frame to its minimal size (64 w/o preamble/SOF) and calculate the correct frame check sequence (FCS).

The frame then needs to be line encoded. 10BASE-T uses simple Manchester code (01="1" and 10="0"). 100BASE-TX uses 4b/5b line code. 1000BASE-T uses a much more complicate line code that's probably outside your project's scope. Most probably the WoL link is 10BASE-T, so that's doable. If you can't take over an existing WoL link you'll also need to generate regular link pulses to make the far side "link up".

All in all, it'll be much easier to wake the hardware using another method if you don't need to do it over the network cable.

If you're using an Ethernet node to generate the WoL packet you can just connect it anywhere in your network, on any switch port. Simply broadcasting the packet will send it to all linked nodes, including the selected MAC.