The sugyah of ta'anis chalom is an interesting one. The gemara mentions it in 3 places. Ta'anis 12b and Shabbos 11a both say fasting over a bad dream is a good thing even on Shabbos. Teh gemara in Berachos 31b says if one fasts on Shabbos a gzar din of 70 years is torn up. Most Rishonim (the RAshba and Rivash) learn this gemara is referring to a ta'anis chalom and that otherwise it is assur to fast on Shabbos.
The obvious question is what is gained by fasting for a dream. The Ritva in Ta'anis (12b) provides a clear hesber. He says that we find some gemaras which indicate dreams are meaningless. However, from this gemara it seem that there is truth to dreams. He answers that when a dream personally affects a person then there is room to worry. It should lead a person to teshuva. Therefor, if one has a bad dream one has a right to worry that it is a message telling you to do teshuva. The appropriate response is to fast.
The question remains why one is allowed to fast even on Shabbos. The Ritva (as well as the Rashba in Berachos 31b) explains that not being able to fast over a bad dream will cause a person tzar. He will be so upset that he can't do teshuva that he will have no oneg Shabbos. For him fasting is an oneg Shabbos. However, according to the Rashba he must make up for not eating by fasting another day.
There is a machlokes Rishonim if this ta'anis is a chiyuv. The Rashba (Shut Rashba 132) says itis not but the Lechem Mishna (Ta'anis 1:12) understands the Rambam that it is a chiyuv.
As far as b'zman hazeh, the Aruch HaShulchan (Siman 120) writes how we are not on teh madreigah for our dreams to mean anything. At most it is not a message from HKBH but from "sheidim" created by our aveiros and therefore one does not need to fast. The Piskei Teshuvos brings the Chazon Ish and Steipler who say the same thing.