I actually couldn't get that to work, so I hooked the Chat_Frame_OnUpdate event handler, which is much simpler, and seems to work fine. hidden is just a boolean that indicates whether I'm hiding the frames or not. Thanks again for the input.
Code:
local ORIG_ChatFrame_OnUpdate = ChatFrame_OnUpdate
function ChatFrame_OnUpdate()
if (hidden) then
this:Hide()
else
ORIG_ChatFrame_OnUpdate()
end
end