Here's a drycoded example of how I can see this working. Without access to unique mob IDs, this can run into problems of false triggering.
Lua Code:
local TargetTimeout=5000;
local function OnTimeout()
if DoesUnitExist("reticleover") and GetUnitReaction("reticleover")==UNIT_REACTION_HOSTILE and ArePlayerWeaponsSheathed() then
TogglePlayerWield();
end
EVENT_MANAGER:UnregisterForUpdate("AutoDraw");
end
EVENT_MANAGER:RegisterForEvent("AutoDraw",EVENT_RETICLE_TARGET_CHANGED,function()
EVENT_MANAGER[(DoesUnitExist("reticleover") and GetUnitReaction("reticleover")==UNIT_REACTION_HOSTILE) and "RegisterForUpdate" or "UnregisterForUpdate"](EVENT_MANAGER,"AutoDraw",TargetTimeout,OnTimeout);
end);