The following environment, copied from this website about dealing with overfull hboxes, allows one to change the \tolerance parameter for just the paragraph(s) it encloses:
\newenvironment{tolerant}[1]{%
\par\tolerance=#1\relax
}{%
\par
}
Unfortunately, the website does not specify a similar environment for locally changing \emergencystretch. Since much of the code in the definition above (notably, the commands \par and \relax) is currently outside my understanding, I would not know how to go about making a similar environment for locally setting \emergencystretch--but I'm sure someone on TeX.SE would know.
How would one write an environment that changes the value of \emergencystretch locally (and makes sure the changes get applied)?