Try adding the following 2 lines just under your HalCommands = HalCommands line...
UltraHal = UltraHal & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, LastTopicList)
Exit Function
If both don't work, just try the first line. Let me know what happens.