Inhaling formaldehyde is not a common cause of chronic cough with yellow productive sputum. Your doctor has to listen to your chest, get a chest xray, and possibly spirometry and even CT scan.
did you see a physician after you ingested these fumes? what did he or she say?