I found that a small pocket knife with a very thin blade worked well to gently pry one corner of the temperature sensor assembly - once that started to come up, I used the plastic spudger to finish prying it up.
While you have the case open this would be a good time to replace the PRAM battery and carefully clean the fan and interior of the case with Q-tips / compressed air.
Used this for my mid-2009 (EMC 2316) 20" iMac - upgraded to a Samsung 500 GB EVO SSD drive. *Just* finished: took about an hour and a half in toto. Just a couple suggestions:
- you'll have the case open: replace the 3V "button" battery while you're in there: it takes 30 seconds and it's done
- have a can of compressed air handy: you can use it to gently clean out the dust, which will have accumulated on the fan blades over time
- I used Carbon Copy Cloner to clone the HD->SSD drive; it worked almost flawlessly: Google Drive needed to be re-synced (easy). Don't forget to deactivate any software that will complain with a change of HD.
- keep in mind that the process is a bit tedious at times: do this when you are rested and have plenty of time; I propped up a laptop with the iFixIt page next to my iMac as I worked on it and this worked well