Hi, and welcome to Just Answer!
I'm assuming your fan is working correctly, you just intermittently can't control where the air comes out correct?
The doors that control the airflow in your heater box are controlled by electric motors. It's fairly common for the doors to break, often times the splines strip out.. When this happens they will typically work intermittently.. The controller tries to move the doors, if they catch and move great.. if it see's the motors move to far it will stop trying to move them, generally until the next time you cycle the ignition key.
Most often on the 03-04 trucks it's a broken door(s). They have released a technical service bulletin on the issue and some revised parts (heavier duty and less prone to breakage).
Now for the bad news, the dash has to come out to replace the door(s). There are two that need to be addressed, and I strongly recomend changing them both (even if only one is broken). Typically it's the door that changes the airflow between the defroster and the panel vents that breaks, but occasionally the floor door will go out also, so change 'em both at the same time.
That's the worst case scenario, it's possible it could just be a simple calibration issue. Disconnecting the negative terminal on both batteries for about 10 minutes will force the heater control head to recalibrate itself when the power is restored, it's doubtfull but this may correct the problem.
Odd's are very good that if they scan it for fault codes they will find a panel actuator overtravel code stored in the heater control head though, sorry for the bad news.
Thank you for accepting my answer, I appreciate it.
The TSB number is XXXXX it deals specifically with the defrost / panel door. The floor door is also upgraded.
When you try to order the TSB parts, they supercede again (there have been 2 revisons to the design at least) and the latest ones seem to hold up well (I've yet to see one with the latest design break).
I wish I'd seen this before I left work as I have the current part numbers written down in my tool box (to speed up the order process) but I won't be back to the shop until after Christmas, if you'd don't mind waiting I can get them for you on Wed.