I would suggest broadway and 41st street, cafe duke, a few minute walk from NYP. You have a few hours, so the walk to/from cafe duke might be refreshing and the food there is incredible.
There are no more dunkin donuts in NYP it's all tim hortons now. Their food and beverage are far superior. There's also the several primo cappuccino locations, they sell variety of beverages, sandwiches, desserts and amazing rice crispy cubes. You also have some stuff over on the LIRR concourse, just follow the signs for the subway, it's a long arched ceiling hallway with 123 trains at one end and ABC at the other, hard to miss.
As far as homeless, there are numerous ticketed passenger only waiting rooms where they are not allowed, but i've never had an issue with them ever in the 11 years of using NYP.
Make sure to get a seat on the left side of the train, so you get the best views. And yea, sleep mask not a bad idea.
Have a fun trip!
Next stop the square, journal square station next!