在 before or after the verb
"在" has at least two functions. 

First "在" can be used to imply something is happening, for example, "我在学习(I am studying)", and in this case it comes before the verb. The verb doesn't have to be about physical movement. 

Second you can use 在 as a preposition, implying the place where something happened/is happening/will be happening. For example, "我现在住在上海(I live in Shanghai now)". In this case it comes after the verb.

"睡觉在" is strange for a native Mandarin speaker. We would just say "睡在".
"我在想在树下面" is also weird. The correct translation for "I am thinking under tree" is "我在树下面想".