As explained in the following documentation "hostname" is part of the default metadata entries and it is not possible to manually edit any of the default metadata pairs.
A post by a GCE Product Manager shows that Google is aware of this issue and are actively working on a feature which will allow you to change VM hostname, but, there’s no ETA. at this time.
That being said, if you still wish to alter this process by changing the "hostname" before the feature is release, there's a couple of workarounds available.
You set that attribute for the file you do not want to change e.g. the hostname file, immutable. You can make the /etc directory including all its content immutable using the following command:
$ sudo chattr -R +i /etc
Or, set that attribute for the file you do not want to change which would be the host's file, using the following command.
$ sudo chattr -i /etc/google_hostname.sh
For more information on making files and directory immutable in Linux, you can see the following article
or see the following Google group article for some examples
Alternatively, as suggested on the GCE public doc you can make static modifications in the resolv.conf file, several Linux distributions allow items to be prepended or appended to the DHCP policy" but I'm unable to confirm what impact this might have on the VM.
You can file a report on User Voice Forum for Documentation feedback (incorrect documentation, general feedback, suggestions)