Squidwards attitude towards both Spongebob and Patrick is completely justifiable. Not only do they constantly break into his house, they disturb him at odd hours of the night, get into his personal business, and are just plain bad neighbors.
I believe that Squidward's attitude towards Spongebob and Patrick is obviously wrong. He shows no patience or tolerance to the two creatures, and bases his feels upon past experiences. In reality, we should all be able to forgive each other, even after we have done something wrong. Of course, he has the right to be angry. However, he has no right to constantly shun them. Matter of fact, the purpose of Squidward's character is to show that you won't get very far by maintaining a sour attitude. Kindness and joy always prevails.
Your right squidward does not show any patience towards either Spongebob or Patrick, though that's to be expected. Squidward has told them many times to not trespass into his home, to keep the noise down, and not to get into his business. Though no matter how many times he's told/asked/ordered and thrown them out they refuse to listen. In fact it usually continues to happen
So yes while forgiveness would be great, Squidward can't forgive knowing that they'll just continue ignoring his requests.
While its true squidward does somewhat shun Spongebob and Patrick, he doesn't shun them all together. An example of this would be during one of the Spongebob Christmas specials where Spongebob and Patrick find out about Santa and get excited about him coming. They eventually get all of the town hyped up as well. In the end Santa doesn't come and Squid in turn dresses as Santa and gives all of his belongings away. Thus also showing he's not always mean and sour.
You do have a good point there. However, a good chunk of the time, Spongebob and Patrick infiltrate Squidward's home to get him to come and play. He refuses nearly every time, and manages to get himself into deep trouble (no pun intended). You are right, he is not mean and sour all the time. Squidward does have some shining moments in the series. Although, no matter how hard they try, the squid just doesn't want to do anything fun. Perhaps, if he were to be a little nicer to them and engage in some healthy activity once and a while, Spongebob and Patrick will stop bothering him...