It's a clever idea. Purely from a writing standpoint, who would have ever thought of using a tree as a guardian? Okay, well, lots of folks, but this is the first tree I've ever seen that takes an active role in the guarding process. It's an old standard that was turned sideways by JKR's fertile imagination.
Oh. God. Just had a thought. More like a major insight, actually...
So most analysts say (and JKR has herself agreed) that the Harry Potter series was based thematically off of Arthurian legend. I won't go into full details here, but if you google Harry Potter and King Arthur you should come up with some of the (very good and insightful) articles that I read.
Anyway, in Arthurian legend, Merlin is imprisoned either within or behind a tree, depending on which story you read. The tree is his guard/guardian. And in HP, the tree is used to guard the entrance to the place where one of Harry's mentors spends a good chunk of his time.
Dang, JKR's good...