Along with Xrystal's advice and to help with debugging, install
BugGrabber
and
BugSack
Without looking at anything it points out that your missing a "then" in config.lua at:
if (SelectedTab:GetID() ~= self:GetID())
and at:
Code:
local function SetTabs (frame numTabs, ...)
you're missing a , (comma) after frame
there may be others.