1- Why did I do that?
2-When I was young, why did I do that?
3-(The same as above)
4-Why did I do that when I was young?
5-Why did you do that with me when you were young?
6-When you were young, why did you do that with me?
7-Why - when you were young - did you do that with me?
Very well done, although watch the order of your sentences :)