The link text includes the opening "|H" so you'll want to change
Code:
local LinkType = string.split(":", linkData)
to:
Code:
local LinkType = strmatch(linkData, "|H(.-):")
to catch only what's
between the opening "|H" and the first colon.
Also, you don't need your whole SetOrHookScript function... just use HookScript directly. If the frame doesn't already have a script of that type set, HookScript works exactly like SetScript.