IIRC the N900 has a light sensor as well. Porting autolock shouldn't be a big problem if the D-Bus interface didn't change too much.
I thought a proximity sensor woked on, well, proximity? I mean, what if you're using it in a dark room? I thought the N900 had light sensor and proximity sensor.