Yes what you did is correct,
Doing L'hopitals requires taking the derivative of $(1+x)^x$ where $a=$ 1 or 2, is really complicated and won't cancel very easily, here is the derivative if you wanted it:
$
\frac d {dx} (1+x)^x = \frac d {dx} e^{xln(1+x)} \\ \ = e^{xln(1+x)} \frac d {dx} (xln(1+x)) \\ \ = e^{xln(1+x)} (ln(1+x)+\frac x {1+x}) \\ \ = (x+1)^x (ln(1+x)+\frac x {1+x})
$
So you can see how complicated it will get.
I would go with what you started with, and do this:
$
\lim_{x \to \infty } (\frac {x+1} {x+2}) ^x \\ \ = \lim_{x \to \infty } (1 - \frac {1} {x+2}) ^x \\ \ = \lim_{x \to \infty } (1 + \frac {-1} {x}) ^x (1 - \frac {1} {x}) ^{-2} \\ \ = e^{-1} (1+0)^{-2} \\ \ = e^{-1}
$