Q:

When describing time span, are 間 {あいだ} and 内 {うち} interchangeable?

Both 間 {あいだ} and 内 {うち} can be used to describe time span relative to specific situations, similar to "while" in English. But are they interchangeable all the time? Are there any scenarios where one can use one of them but not the other? Are there differences in nuances?
Example sentences of my own (I'm not sure if they are correct or not so if they sound wrong please point out why):

先生が見てない間に逃げよう
先生が見てない内に逃げよう

A:

Edited to replace the word "measure" with a better concept.
間 refers to the time space between two points; speaker feels he has the ability to determine a start and end point at the moment of making the statement. (間 has explicit time boundary)
内 however refers to "time space within"; for when it is difficult for the speaker to determine a start and end point. It refers to the general time during which an event/state is occuring. (No explicit time boundary for 内)
That is why it seems strange to say (though not totally unacceptable)[1]:

雨が降らない間にテニスをする。

But is okay to say:

雨が降らない内にテニスをする。

Because one cannot assess the start and end point of the duration within "not rain"

In your example　先生が見てない(間に/内に)逃げよう,　the time during "teacher is not looking" isn't a predictable or planned event (No explicit time boundary). Therefore 内に would be more appropriate for your example sentence.

Edited: To try to explain the apparent contradiction with Tsuyoshi's example using 晴れている:

晴れている［○間に］［○うちに］作業を終わらせよう。
Versus,
雨が降らない［×間に］［○うちに］作業を終わらせよう。

It should have something to do with the speaker's expectation of future circumstances:
The speaker takes the default standpoint of "clear weather" as a default weather.
We normally do not worry "when the duration of [clear weather] ends". But rather we would think in the manner of "when does [other weather] begin?". It becomes unimportant to assess a start and end point for a default standpoint. Since it's a default standpoint, both 間 and 内 can be used and will not sound unnatural or not smooth.
For [other weather] there is a start and end point, but the speaker expects [other weather] (e.g. rainy) to behave in a way that he cannot determine a start and end point for it.

Now for the case of "teacher is not looking", the speaker takes the default standpoint of "teacher is always paying attention" because that is how he would expect the teacher to behave. The alternative: duration of "teacher is not looking" becomes hard for the speaker to determine a start and end point.

References:

[1] Makino, S., & Tsutsui, M. (2010). A dictionary of basic Japanese grammar. pg. 512-515 entry for uchi ni 

A:

In the example you give and similar constructions, I think they are pretty much interchangeable.
I however found some interesting Q&A on a bbs:

若い［×間に］［○うちに］いろいろなことを経験したい。
忘れない［×間に］［○うちに］メモしておこう。
全部見終わらない［×間に］［○うちに］出て行ってしまった。
つきあっている［○間に］［○うちに］好きになってきた。

The conclusion of this link is 間 is a span of time between two points, 内 is the "inside" of a "time frontier".  内 seems thus used with a change of state (with the frontier distinguishing the two states), until that change happens.
Chie suggests a chance in 内 that isn't implied in 間。

子供が寝ているうちに電話する (now or never!)
東京に旅行しているうちにいろんなところへショッピングに行く (I may not be able to do that much shopping before a while!)

Hope that helps!

A:

I do not fully understand the difference between 間に and うちに and the following is based on my impression, but let me write it in the hope that it may help in some way.
The difference is subtle.  I think that both your examples work, and neither of them hits me as odd.
Let me focus on the case where the duration is of the form ～ない.  I think that in this case, うちに is usually more natural than 間に.  The following examples by Oyanagi on the page which Axioplase linked to are very interesting:

（６）晴れている［○間に］［○うちに］作業を終わらせよう。
  （７）雨が降らない［×間に］［○うちに］作業を終わらせよう。

I do not agree with Oyanagi that 雨が降らない間に is completely incorrect, but I share the feeling that it is less natural than the other three combinations.
But I think that this tendency is weakened when the duration is of the form ～ていない (or its colloquial contraction ～てない, as in your example).
Also, 知らないうちに and 知らない間に both sound correct and natural to me, and I know that I am contradicting myself.  That is why I cannot write anything definite here.
(By the way, 間に is sometimes read as まに instead of あいだに, for example in 知らぬ間に and the idiom 鬼の居ぬ間に洗濯, but I ignored the reading まに for the purpose of this answer because the difference between あいだに and うちに seems already complicated.)

