If this were an elementary class, I would recommend revoking recess. They would have to sit at their desks while remaining absolutely silent. They would have to listen to a talk about appropriate conduct and respect. Any student who so much as rolled his or her eyeballs or made an audible comment or sniffed would subject the class to yet another time out.
Since you work with older students, I would not accept oral insults. Erasing the written comments without saying anything was a good idea since you didn't know who wrote the comment ... but the moment students began articulating their thoughts, you should have taken action.
I'm a great believer in assertive management and feel that there should be consequences for all of the choices that we make in life. Students who are behaving in an inappropriate manner should be warned. If the behavior persists, there should be a consequence i.e. detention, teacher-parent conference, time out for a private discussion in the hallway, failing grade for the day etc. If the behavior persists beyond this point, I'd write the student up and send this student to the office.
You need to be firm, fair, and consistent with students. You can't let them "get to you" because if they see that you're flustered, the behavior will get worse.
I once earned supplemental pay as a school bus driver. As a certified teacher, the transporation depot gave me the worst route. I was assigned the job of driving middle school students home after school.
On the first day of the job, the students refused to be seated. They threw items out the window. They ate on the bus. They stuck their heads and arms out the bus windows while we were on the interstate.
I pulled the bus over and read them the riot act. I reminded them that by their age, they should be familar with bus rules. Since they had clearly forgotten, I spent several minutes going over the rules while the students hooted, cursed, threw things at me, and laughed.
I warned the students that if this behavior persisted, I would turn the bus around and take them back to the transport dept. The students would then have to call home for a ride. I ended my lecture by reminding them that riding the bus was a privilege and that students who did not behave appropriately would not be allowed to ride.
"F**K YOU!" shouted some of the students.
I merged back onto the interstate, took the first exit, turned the bus around and true to my word, returned to the bus depot. There were nearly 60 students on the bus. I think it took 1 1/2 hours for them all to call home since the dispatcher only had one phone for them to use.
The dispatcher winked at me and told me to log out and go on home. She said she'd stay with the kids until all of them had been picked up.
The students continued their misbehavior on the 2nd day. I had to again pull the bus over and repeat my lecture. After being told what I could do with myself, I again returned the bus to the depot with the students still on board.
By the third day, things were better, but a group of students persisted in misbehaving and much to the annoyed shouts of disgust (directed at the other students), I again returned the bus to the depot.
On the 4th day, the students were profoundly quiet and respectful. I was shocked because by this point, I was on the verge of quitting.
I had no more problems ... and the transport depot rewarded me by switching me out with another middle school bus driver who was having problems with HER students.
So ... stand your ground. Be firm. Be fair. Be consistent. Take no grief from anyone. Don't let the students see that you're upset. Don't take their behavior personally and remember that everyday starts afresh.
If you're calm and persistent, you will eventually gain control of this class.
The students may not like you - but that's too bad for them. You're not there to be liked. You're there to teach.
With this being said, you should also know that despite your best efforts, some students are simply not ready to learn. You can't force students to learn but at the same time, these students cannot be allowed to disrupt the classroom climate by intefering with those classmates who want to participate.
If some students choose to do nothing and learn nothing and be nothing - there will be consequences for that.
I've always thought of this as educational triage.
Sometimes, despite your best efforts - you can't reach everyone. So what do you do? You focus your time and effort on those you CAN reach. As for the others - if they choose to sit and fail, they're welcome to do so as long as they're not disruptive.
I would back this policy up by thorough documentation.
Keep a daily log of what happens in your room so that if parents or the school administration want to know why Jason got a failing grade - you'll be able to reel off a list of dates and times during which he sat and did absolutely nothing.