Gwilym,
You are correct that there could in fact be a script located on the server hunting for writeable scripts: However at this time we're unable to find one.
I'd highly recommend following the advice in the thread you've posted.
The specific one is:
DannoUK - what's almost certainly happened is this:
A malicious script has been set loose on the webhosts server.
That script searches for files that it can write to.
Such files are usually theme files.
This is not WP hacking as much a combination of a webhost security and your file permissions.
Download your current theme.
Go through each file in that theme checking for the garbage code.
Delete it all obviously
Upload the files and then change their permissions to 644 and NO higher. No 664 / 666 or anything else.
Check the site works.
If not, check your file editing.
You cannot now edit files online.
NO files on a site should ever be writable and if they are you must know where, why and the risks.
Let us know if you have any further questions or concerns.
Dave M.
Hostgator Customer Support