There is nothing wrong with sleeping on a (tray) table except you are responsible if you break it with your weight or whatever.
You may not pull on someone else's seat in order to get up but the person next to you (including in front) is supposed to upon notice move to allow you to get up and out or otherwise risk being climbed over.
On most airlines, to get a better position for the laptop or DVD player, pull the tray table horizontally towards you.
Travel tips:
http://members.aol.com/ajaynejr/travel.htm