It will take me a minute or so, so getting this in place to give Google Hope

I helped CT code his old old SS code, and it's basically the same philosophy.
*edit*
now that im really looking at this, i really am not following your logic chain here lol
if focus has the debuffs, and not target, why aren't we just SSing on to the target and staying on the target?
also you have WAY to may ends
also i don't really see UnitGUIDs being used the way they should be. What you're going here is basically using it as a UnitExists check but even that is going to nil out :-/
i'll paste your old code on top of mine, but even more probably wont work the way you want it to
PHP Code:
local unitguid1 = (UnitGUID("target"))
local unitguid2 = (UnitGUID("focus"))
local EnemyHP = 100 * UnitHealth("target") / UnitHealthMax("target")
if unitguid1 ~= UnitGUID("target") then
unitguid1 = UnitGUID("target")
end
-- If the current focus has rake or rip, check cd on Soul Swap, and cast Soul swap on current target, then set current target
-- to new Focus.
if EnemyHP > 20
and (UnitDebuffID("focus",1822)
or UnitDebuffID("focus",1079))
and GetSpellCooldown(110810) == 0 then
CastSpellByName(GetSpellInfo(110810), "focus")
FocusUnit("target")
return true
-- If the current target has rake or rip we do nothing.
elseif unitguid2 ~= UnitGUID("focus") then
unitguid2 = UnitGUID("focus")
end
if (UnitDebuffID("target",1822) or UnitDebuffID("target",1079)) then
return false
end
-- Bu_Ba_911s code changes
local unit1 = UnitExists("target")
local unit2 = UnitExists("focus")
local EnemyHP = 100 * UnitHealth("target") / UnitHealthMax("target")
if unit1 and unit2 then
-- If the current target has rake or rip we do nothing.
if (UnitDebuffID("target",1822) or UnitDebuffID("target",1079)) then
return false
elseif UnitBuffID("player", SSBUFFID) then
CastSpellByName(GetSpellInfo(SS), "target")
return true
end
-- If the current focus has rake or rip, check cd on Soul Swap, and cast Soul swap on current target, then set current target
-- to new Focus.
if EnemyHP > 20
and (UnitDebuffID("focus",1822)
or UnitDebuffID("focus",1079))
and GetSpellCooldown(110810) == 0 then
CastSpellByName(GetSpellInfo(110810), "focus")
FocusUnit("target")
return true
end
end