Hey I figured it out on my own.
I'm gonna post my final code here just in case someone else has a similar project. I added a couple strings to help prevent myself from creating typos. I also had an unnecessary space in my elseif statement. I'm pretty new to scripting in Xpression, so I hope my code doesn't look like total trash to people who have been doing it for a long time lol
dim fb as xpOutputFramebuffer
dim mainl3 as xpScene
dim bar,sep,flag as xpBaseObject
dim redborder,blueborder,redsep,bluesep,redflag,blueflag as xpMaterial
dim Breaking as String
Breaking="2020 Breaking Main Lower Thirds"
dim NormalL3 as String
NormalL3="2020 Main Lower Thirds"
'Get Objects in Scene'
Self.GetObjectByName("Bar",bar)
Self.GetObjectByName("Seperator",sep)
Self.GetObjectByName("Flag",flag)
Self.GetObjectByName("Text1",MainText)
'Get Materials'
Engine.GetMaterialByName("New Subtext Lower Third Longer_Image",blueborder)
Engine.GetMaterialByName("Section Seperator_Image",bluesep)
Engine.GetMaterialByName("FlagBG_Image",blueflag)
Engine.GetMaterialByName("Breaking Subtext L",redborder)
Engine.GetMaterialByName("Section Seperator_Image1",redsep)
Engine.GetMaterialByName("Breaking Flag",redflag)
Engine.GetOutputFrameBuffer(0, fb)
fb.GetSceneOnLayer(-2, mainl3)
if mainl3.Name = Breaking then
bar.SetMaterial(0,redborder)
sep.SetMaterial(0,redsep)
flag.SetMaterial(0,redflag)
elseif mainl3.Name = NormalL3 then
bar.SetMaterial(0,blueborder)
sep.SetMaterial(0,bluesep)
flag.SetMaterial(0,blueflag)
end if
#XPression