Frequent outbursts in court led to a judge continually warning a man sentenced for harassing his neighbour