You sit around and wait. There isn't much to do there, even the airline lounges I have been in are nothing special. I am not aware of any in-airport hotel (and everywhere I've encountered these, they are NOT dodgy but provide a useful service), but have never hung around PVG for long enough to look for one either.
The Ramada or Radisson (I forget which) is at least a few miles from the terminals: taking a taxi into town, you would pass it. There are other hotels nearby to the Ramada -- none of these are reasonably accessible with a four hour layover.
Bring a book.