Figured it out myself, made it work with this code (trying to set the 'selected' property of 'w_ap' if p is the currently selected node):
if p == commander.p:
w_ap['selected'] = True
Latest version of leoInteg implements the 'getParent' method which is a requirement in vscode to have the powerful 'reveal' functionality in the tree. I try it out in the public test() method, with the 'getSelectedNode' function.
I've yet to implement body/outline editing and manipulation having any effect on leo's side of things, but I think its going to be trivial once this basic 2 way communication and gui rendering is more fleshed out.