No you don't have to edit oUF. It supports custom show conditionals à la macros.
For example the header spawn would work something like this:
Code:
party = self:SpawnHeader('oUF_Party',nil,'custom [group:party,nogroup:raid][@raid6,noexists,group:raid] show;hide',
'showParty',true,
'point','TOP',
'xOffset',0,
'yOffset',-4)
and
Code:
for i = 1,5 do
local raid = self:SpawnHeader('oUF_Raid'..i,nil,'raid10',
'groupFilter',tostring(i),
'showRaid',true,
'point','RIGHT',
'xoffset',-4,
'yOffset',0)
end