Well, since that is a jass function, you need to place it in the custom script section in the world editor (in the trigger editor, above all triggers and folders, click on your map blabla.w3x and it should pop up some empty space which you simply copy and paste the function into.)
To use this function as an action in a trigger, select custom script from the action list, and then "call function_name(paramter1, parameter2, paramerer3)" etc.