I didn't look through your entire addon, but the most likely cause of the problem you described is that SUF doesn't create its frames right away when it loads -- it probably waits for PLAYER_LOGIN or some other later event, which means that your addon needs to do the same. However, there's no guarantee that registering for the same event will make your event handler run after SUF's event handler, so the best solution here would be to just hook the SUF function that creates the frames, eg. if that method is "ShadowedUF:MakeAFrame(unit)" then you'd hook it like so:
Code:
if ShadowedUF then
hooksecurefunc(ShadowedUF, "MakeAFrame", function(ShadowedUF, unit)
if unit == "player" then
-- SUFUnitplayer has already been created by the original function, do what you want with it here
end
end)
end