Malfunctioning Heater Volvo

Heater produced no heat with first use this winter but fan worked. Took in to Volvo dealer to be checked and was told that it could be one of three motors to be replaced (was not sure which one) and an estimate for around $500. Tech removed a blower filter that was dirty and clogged and told me “at least you’ll have heat that you can control with the fan” until you bring it back in. NOW, I have heat blowing when fan is off; heat when AC is on (and defroster); sometimes NO heat when it’s cold and I need it; and, today, a “clicking” sound intermittently coming from under dash and “check engine” light came on and stayed on. I really can’t afford the repair bill. Any ideas?