About an ePO agent and preventing duplicate GUIDs? We're just running the automatic agent installation .exe (which you can download from the ePO server) during RunOnce with a customization specification.
You could also just delete that registry key on the template before you shutdown and convert the VM to template. That saves you having to delete it on every deployment again.