Just to make sure: please check your BIOS and confirm you did not put 'boot from LAN' as the 1st boot option. I assume it is not since moving the lid crashes your system.
PXE errors are generated by the network boot ROM: the boot process is attempting a network boot (probably your BIOS' 4th boot option), which means that your system was unable to boot from a HDD, CD-ROM, or USB device (the 'standard' first 3 boot options).
The error you posted "media test failure, check cable" to me holds the most sensible answer: the hardware inside is faulty. When moving the lid it causes a power shortout causing it to reboot/crash. Find someone or a company that can safely open it and have a look inside.
I do not believe it to be a HDD failure that would result in other type of errors more focused on
files not found. You can some what try to confirm this by inserting a bootable cd and start from it. Move the lid and if it crashes you can comfirm it to be more likely to be hardware related.