Drop a TTimer to your form, set Interval to 200, Enabled property to false, then on popupmenu close:
Of course you shouldn't do this in PopupMenu1Close because then it will switch to edit-mode for every-menu item you choose (which you might not want. For example for the delete menu item).
Only enable the timer in the menu-items where you want to edit the item:
procedure TForm1.MenuItemXXXClick(Sender: TObject);
begin
Timer1.Enabled := true;
end;
procedure TForm1.tmWaitTimer(Sender: TObject);
begin
Timer1.Enabled := False;
if not TreeView1.IsEditing then
TreeView1.Selected.EditText;
end;
The problem is that switching to editing mode while in an event of a menu-item doesn't always work (for instance in case of keyboard enter, the enter key is still in the queue and is executed in your EditText).
Another possibility would be to do a PostMessage to your form and switch to editing. But the timer-method works good too.