A man who claimed a teacher sexually abused him when he was attending high school in the 1980s has agreed to a $3 million settlement of his Middlesex County lawsuit.