If the computer is still working correctly (apart from having a distorted image), this probably indicates some sort of magnetic interference. Internally (in your mac), all components should be shielded against that, so I'd guess it is your power transformer that goes bad on you once it's reached a certain temperature level. just a wild guess though.
have you tried different locations for your mac, maybe there is some external interference? another power transformer? (maybe a stronger one?)
In case you have other displays available /(maybe from friends):
try plugging in an external display, possible CRT, and see what the image looks like there. and try an LCD, to see what the image looks like when magnetic interference should not play a role.