A nightmare neighbour left tripwires and broken glass outside his home in a tirade of harassment against residents, a court has been told.