So, I have not had a working refrigerator for four months. I told my landlord of the issue when I was paying rent at the beggining of April. Their response was something along the lines of "we'll get that sorted out right away!"
Fast forward a couple months of me barely being able to stay there, and living out of a cooler when I do.
I was reassured in the beginning of June, while giving him rent, that the refrigerator would be replaced the following weekend. Needless to say it never happened. So when it came time to pay rent for July, I decided to withold after reading up on the habitability rights of tenants in Massachusetts. The refrigerator was provided with the rental of the unit and not maintained in working order. I have not had the Health Dept. come, though I understand that I can do so. I told my landlord about said habitability rights when he came looking for July's rent. He has still not replaced my refrigerator, and has done nothing other than swing the door open to verify that it has fallen into disrepair.
Last night, as I was leaving for work (third shift) there was an envelope outside my door. I recieved a handwritten letter (dated August 4, 2011) stating that if I did not vacate the unit by August 7, 2011 that the locks would be changed and I would not be able to enter it. As well as the letter I recieved what I assume to be a Notice to Quit (though it was titled 'Termination of Tenancy') dated August 1, 2011. I obviously did not recieve it on the 1st.
What on earth should I do? I know that locking me out is illegal, but I am not sure of what I can do to prevent it. They are effectively trying to get me out over the course of a weekend. If I do get locked out, should I call the cops? a locksmith? Can you file a temporary restraining order on the weekend? Should I file one before this happens? HELP!
(aside from all this, my landlord has on multiple occasions entered my apartment without giving notice, not to make any kind of emergency repair. He was either showing the apartment to prospective buyers [without telling or asking me to enter] or because he thought someone was home but not answering the door.)

Improper eviction
Your landlord is heading for a world of trouble. Self-help eviction (eviction without a court order) is illegal in Massachusetts. If the landlord actually follows through on his threats, you may be entitled to significant damages. For now, if you are truly concerned, go down to the Housing Court and talk to a housing specialist. She will be able to explain how you can file a motion for a restraining order or an injunction. The court can also order the landlord to make repairs. Good luck.