With a 4 hour connection I probably wouldn't do it. It is possible but you have to take into consideration the following:
- how long it takes you to get from your arrival gate to immigration.
- how long it takes for immigration when you leave HND and when you arrive back at HND.
- do you need to find a place to store your bags
- time you might spend waiting for trains
I am assuming you're not familiar with the area around HND and the last thing you want to have to worry about is cutting it close to catch your flight out of HND for maybe 60-90 minutes of sightseeing around Tokyo.
Not sure what class of service you are traveling in or if you have *G status with a Star Alliance member, but the NH lounges at HND aren't too shabby if you have to spend your time in transit. FYI, if you do have access to the NH lounge and plan to take a shower there is usually a wait especially if you are departing on one of the late evening departures (2200 - 0100). Depending on when you are at HND, 1 of the 2 NH lounges might be closed.
http://www.ana.co.jp/wws/japan/e/asw...ail.html?c=hnd