It looks like you're using the CopyTo method to copy the item to the destination. To ensure that the content tree is updated and the focus shifts to the copied item, you can try the following approach:
After the CopyTo method, you can use the Editing.BeginEdit() and Editing.EndEdit() methods to simulate an edit operation and force a refresh of the Content Editor. Here's an updated version of your code:
var item = args.GetItem();
var destinationId = (args as CopyItemsArgs)?.Parameters["destination"];
var destination = args.GetDatabase().GetItem(destinationId);
// Copy the item to the destination
var copiedItem = item.CopyTo(destination, ItemUtil.GetCopyOfName(destination, item.Name));
// Begin and End Edit to refresh the Content Editor
using (new EditContext(copiedItem))
{
// No need to make any actual changes, just the act of beginning and ending the edit will trigger a refresh
}
// Optionally, select the copied item
Sitecore.Context.ClientPage.SendMessage(this, "item:load(id=" + copiedItem.ID + ")");
In this updated code:
The EditContext is used to simulate an edit operation on the copied item.
This should trigger a refresh in the Content Editor, and you should see the copied item selected.
Optionally, the item:load message is sent to select the copied item explicitly.
Could you please try this and let me know if it helps?