Ubuntu: Take actions when system temperature gets too high

Use computertemp:

http://computertemp.berlios.de/

The last screenshot is exactly what you want (actions upon alarm):

http://computertemp.berlios.de/screenshots.php

As far as your goals:

(1) Adjusting CPU frequency: http://www.linux.it/~malattia/wiki/index.php/Cpufreqd (trigger this with a computertemp alarm)

(2) Clean shutdown at upper-limit temp: "shutdown -h now" as your triggered command

You might also need lm-sensors installed (or not, read the computertemp docs).

You can add it to your panel:

http://ubuntuforums.org/showthread.php?t=805702

Finally, I feel compelled to suggest buying a MacBook or MacBook Pro as your next laptop.