Your coughing and spitting up are your lungs cleaning out all the junk from all the years of smoking. I experienced the same thing when i quit smoking and it's really nothing to be concerned about. You might see some blood when you spit up but that could be from coughing too hard. If you cough up blood alot you might want to see your physician.