If you want to open the document for editing via Dojo rather than Server-Side JavaScript you just need to generate a client-side URL to the document. This would be something like "myXPage.xsp?documentId=xxxxxxxx&action=editDocument" or "/0/xxxxxxxx" where the Form is set to open in the relevant XPage and the default action for your data source is to edit the document. Either way "xxxxxxxx" isa the UNID of the document.
If you open documents with the relevant actions you'll see how the URL is made up.