The SetScript part isn't going to affect the AH, you're right, but the suggestion is still valid. SetScript replaces whatever function was on that frame while HookScript adds a function to a frame. When dealing with frames you didn't create, especially Blizzard frames, you should use HookScript.
As for your issue, try using the set search function the UI uses instead of setting the text directly, along with nil protection just in case:
AuctionHouseFrame:SetSearchText(t.name or "")
|