Funny thing, I was just thinking about this today.
I was a smoker for 15 years and for the last 2 years I would cough up these brownish mucus balls every morning. I have been vaping for about 2 weeks, and haven't smoked an analog in over a week. I have noticed I haven't coughed up anything in the last 2 days. I still cough a little in the morning, but nothing comes up. I'm guessing the mucus was caused by the cigarettes.
Hopefully in a few weeks you will stop coughing up black stuff, but if it doesnt go away I would see your Doc.