Actually after staring at it some more the whole thing should be able to be reduced to this
(if all you care about is hiding all chattabs)
Lua Code:
local eventframe = CreateFrame("frame")
eventframe:RegisterEvent("PLAYER_LOGIN")
eventframe:SetScript("OnEvent",function()
local tab
for i=1,NUM_CHAT_WINDOWS do
tab = _G["ChatFrame"..i.."Tab"]
if (tab) then
tab:Hide()
tab.Show = tab.Hide
end
end
end)
drycoded.