Dear Molly,
This is a great question. This issue has often arisen in the field of Conversation Analysis. In that area, what is often quite interesting is how the two conversations may begin at one with say 6 participants. Then two people start to break off of divide from the group to form their own tighter conversation, essentially ignoring what the others are saying. Later, they may rejoin the main conversation. When this happens, creating a readable transcription is extremely challenging, even if you go into some sort of time-based software like ELAN. Of course, the situation you described doesn't include these processes of division and rejoining, but probably they were there too.
Given these issues, my suggestion would be to create two separate transcripts. One transcript would be for the most basic conversation which might the conversation with the teacher. Then I would mark in that transcript when the secondary conversation begins and ends. The secondary conversation would be in another transcript and it could have marks about where it fits into the primary transcript. If you use CLAN time alignment facility, you can have the exact times of fractionation and reattachment.
This takes a lot of extra work. If you really are primarily interested in a given conversation, you could always choose to ignore the secondary one and just note in comments what is going on there.