There might be a different way, but you could hook into its OnEditFocusGained and OnEditFocusLost scripts.
Note that, if it loses focus by the player clicking another edit box, 'OnEditFocusLost' will trigger twice.
Lua Code:
ChatFrame1EditBox:HookScript("OnEditFocusGained", function()
print("gained")
end)
ChatFrame1EditBox:HookScript("OnEditFocusLost", function()
print("lost")
end)