Close.
Hard to say what's happening exactly as I'm not sure exactly which object you are passing your function. But you are using the wrong information, and clicking in the wrong place. You're also trying to interpret and object by moving the mouse to it and getting the object under the mouse at that point? If there are overlays and things in place, that could all go horribly wrong.
Anyway.
Using the example here: http://www.jqueryrain.com/?KIVkhqxl
As it looks most similar to yours. (But may not be. It looks like there are various ways of building these and this looks closer than the other example I found.)
This code (VBScript - which is what you're using by the look of it):
Function ClickNode()
Dim searchPROP(1)
Dim searchVAL(1)
searchPROP(0) = "contentText"
searchPROP(1) = "className"
searchVAL(0) = "root2*"
searchVAL(1) = "node-wrapper"
Set tree = Sys.Browser("iexplore").Page("http://www.jqueryrain.com/?KIVkhqxl").Frame(0).Panel(0).Panel(0).Panel(0).Panel(0).Panel(0).Panel(1).Panel(1).Panel(0).Panel(1).Panel(0).Panel(0).Panel(3).Panel(0).Panel(0).Panel(0).Panel(0).Panel(0).Frame(0).Panel(0)
Set node = tree.FindChild(searchPROP, searchVAL, 2)
y = node.Height / 2
x = 4
node.Click x,y
End Function
Will expand/contract the second node in tree on that example page.
It's simple enough.
Assigns the tree container to an object.
Searches for the node it wants within the tree using the content text and class name. You have to use two parameters to make sure you get the single line. If you don't, and search using text only, it will find the container wrapper for the entire node (including child nodes if it's open) and the co-ordinates could be wrong (they'll be wrong if the node is expanded). You have to isolate it to the single line within the node. With a "*" in the text search part as it's only the first, main text, part I'm after.
Assigns that to an object.
Gets the height of the node and divides by 2 to get the mid-point.
Don't need the width as we know it's the little arrow on the left we want to click so it's hard-coded to 4.
The height on this is example is 29. So call it 15 once divided by 2.
It then applies the Click on the node it found at point 4 , 15 within the object. So 4 pixels in halfway up.
And the node expands. Or contracts. Depending what state it's currently in. (You can also check that.)
If you change the text search string to "asyncroot*", it will do the same to the third node. Etc etc.
You would need to add to this. Pass in parameters. Add some error handling. Put it in some sort of stepped loop if you need to go several levels deep. But this demonstrates the basics of clicking a single node. Open the sample I linked to in IE and try it. (Should work in Chrome as well but it looks like Chrome updated itself last night and I'm going to have to update or patch my TestComplete install to get it working again. Sigh.)