When document properties are updated like the "Category" that the document belongs to, the HPI tree view is not notified and not updated.
The DocAddController fires javascript that causes the items added to be placed in the proper locations in the tree. Use something like this to move the documents.
Update: It seems updating the NAME of the documents triggers an update in the tree view, so definitely use whatever events are alrteady being fired to properly move the nodes.