On an ‘07 GS350, fishing the ballast-to-headlight connector cable through the headlight assembly is nearly impossible. Some people take off their headlight covers with a heat gun (which shouldn't be done without replacing the headlight lens and applying fresh sealant) while others cut a hole in the bottom to make room for it to pass by.
On the A1278, it’s on the end of the HDD cable, positioned to one side of the trackpad. You can test it by putting a magnet over the area. If the system sleeps randomly, the HDD cable with the hall effect sensor need to be replaced. Be sure to replace both at the same time.
Had this happen on an A1278; couldn’t figure out why. Magnetized USB connectors were the problem. Demagnetize them with something like this: https://amzn.to/2CEM4pJ There are 4 strong N or S domains on the upper display border by the camera, starting about 2” from the outer edge of the display clamshell and ending about 3-4” inches in, on both right and left sides. This makes me think there’s either 1 or 2 clamshell sensors (hall or reed type) in the palm rest on either side of the trackpad. pmset -g log: … Display is turned off … Entering Sleep state due to 'Clamshell Sleep' …