4 hours is pretty tight. The train takes about 45 minutes each way, if I recall correctly, and runs, I think, every 7 minutes or so. I can't imagine a cab would be a whole lot faster, though the cab could take you straight to your destination, whereas with the train you'd have to transfer to a metro train, which would add another 10 to 30 minutes or so each way. The cab would be much more expensive, of course.
I would not recommend to most of my friends to try to make the trip in. But I have a history of pulling stunts like this and getting back to make the flight by the skin of my teeth (missed one, once), so I'd be tempted to do it, especially if I didn't think I'd be back in Paris for a while.
The next question, of course, is if you do try it, what one thing in Paris is going to give you the most of what makes the risk worthwhile in the few minutes you'll have in the city? The mind boggles to consider the possibilities. If you've never been to Paris and will not likely return, and if you're willing to risk missing your connection, I'd take the train in and take tht Metro to the Trocadero stop to see the Eiffel Tower, then reverse the process and pray I got back in time. If you first see the tower from the vantage point offered by arriving from the Trocadero stop, you'll feel like the trip was worthwhile.
On the other hand, 4 hours is a really good period in which to indulge in a wonderful French lunch or dinner at the restaurant just inside the entrance to the Sheraton (I've forgotten the name of the restaurant, and the Sheraton is part of the airport -- just above the train terminal), or failing that at the airport branch of the Brasserie Flo (or is it another famous brasserie that has a branch there?). It's a good way to experience some of the magic of Paris, and the heart palpitations will come only from the clogged arteries rather than the stress of trying to make it back to the airport on time.