Attorneys involved in the case said the sweeping finding is “unprecedented” and stands to impact how courts across the country address opioid addiction.