On my 12" aluminum PowerBook, the sensor is on the right palmrest under the right arrow key, and there is a magnet on the lid in the corresponding position. Take a thin flat piece of steel, say 1" by 0.5" (a big paperclip works for me) and stick it to the magnet on the lid, then close the lid. The metal blocks the magnetism, and the PowerBook will not sleep! Great for carrying the book from place to place while it continues to run. Just be careful to use a piece of metal that won't scratch the machine's finish.
[robg adds: I haven't tested this one, and I'm not sure what the official Apple stance is on running the machine with the lid closed but the display active (which it would be unless you dimmed it, I believe). Proceed at your own risk. Given the minimal time it takes to sleep and wake under OS X, I'll personally stick with letting the machine go to sleep when the lid shuts.]

