You should definitely not use SetScript on frames that aren't your own, rather use HookScript, as it will append the script snippet with your code rather than replacing the original script function. Having that said, I don't think it's generally a good idea to hook shit onto the WorldFrame. You could just create your own invisible frame and have it propagate the keyboard input instead. Like this:
Lua Code:
local f = Test or CreateFrame("Frame", "Test", UIParent)
local function TestPrint(self, key)
print(self:GetName(), key)
end
f:SetScript("OnKeyDown", TestPrint)
f:SetPropagateKeyboardInput(true)
Also, get in the habit of localizing your functions.