Having tested alot with this problem, i found this:
Whenever i have string in my sketch which has threee marksigns in a string (eg: "!!!"), my sketch will make the Mega2560 timeout when uploading ("huh?..bootloader>" hex code message followed after multiple retries by avrdude: stk500v2_ReceiveMessage(): timeout ).
Using Windows 2008 R2 Server (think Win7 64 will do the same), Arduino IDE 1.0 & Arduino Mega2560 compatible.
Here's a sample sketch to reproduce the error:
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.println("!!!");
}
Hopefully this will help.