On the Role of Depth and Looping for In-Context Learning with Task Diversity