Stealing from Blizz. code, add this to your timer before the other code:
Lua Code:
local canUseRated = C_PvP.CanPlayerUseRatedPVPUI();
local canUsePremade = C_LFGInfo.CanPlayerUsePremadeGroup();
if canUseRated then
PVPQueueFrame_SetCategoryButtonState(PVPQueueFrame.CategoryButton2, true);
PVPQueueFrame.CategoryButton2.tooltip = nil;
end
if canUsePremade then
PVPQueueFrame.CategoryButton3.tooltip = nil;
PVPQueueFrame_SetCategoryButtonState(PVPQueueFrame.CategoryButton3, true);
end