My understanding of the difference between 間に (usually written with kanji) and うちに (usually without), is that 間に expresses the continuation of time whereas うちに expresses the continuation of circumstances. For example 若いうちに (while you are [still] young), indicates the condition of your being young, whereas 夏休みの間に (when I was on vacation) expresses the duration. Note that 夏休みの間 expresses a general timeline and 夏休みの間に expresses a specific point. They both express continuation of an action/circumstance so there is some overlap, and as for your sentences I couldn't tell you which is more appropriate. If I took a shot in the dark I would say that うちに there carries the nuance that "unlucky you, it started raining while you were walking home [but let up once I got inside]," because you're making a point to say that it started with the condition of your walking rather than simply the time you were walking.
I could be wrong, though. Subtleties can be kind of difficult when you're studying alone.
One thing I
am certain about is that with the negative v~ないうちに means the same thing as v~る前に. (before *action* happens).
High time to finish what I've started. || Anki vocabulary drive: 5,000/10k. Restart coming soon. || Dig my
Road to Katakana tutorial on the App store.