DB_QuestDef_CloseEvent (as as DB_QuestDef_AddEvent) takes the flag, not the quest update.
So you'd want something like DB_QuestDef_CloseEvent("KillThePig", "QuestUpdate_KillThePig_HappyEnging");
You may be able to use the index in DB_QuestDef_State:
DB_QuestDef_State("KillThePig","HappyEnding",1); means that HappyEnding opens the quest when set. If you want it to close the quest, use DB_QuestDef_State("KillThePig","HappyEnding",-1);
There is currently no index that would open and close the quest.