Dreams aren't ment to be bad. I once had a weird experience where I go through my whole morning routine, sit down for cereal, then wake up at the table eating cereal. Not only was I sleeping and dreaming of my morning routine, but I was sleep walking my morning routine.
Anyway, if you're worried about your health, you have to work on your life habits. A cup of coffee before going to bed and only 4 hours of sleep are definitely not conducive of a good night's sleep.