The only way to do this is to resort to some trig. You have your location and radius, the tree's location and radius and your desired direction. Draw it out and it should be fairly straight forward what the required calculation to move adjacent would be.
I don't think the bytecode will be a big issue and it should only be triggered when you can't move and the recent reduction in bytecode cost of math functions. The most expensive will be sensing the tree but you may already know it or you can use one of the 'get tree at location' methods.