Create new action, select custom script. Then enter the script.
Lcation removing:
call RemoveLocation(udg_variableNameHere)
Unit group removing:
call DestroyGroup(udg_variableName)
Replace the variableName with then name of your variable.
If you want to use points or unit groups, first set them to a variable, for example:
TempLoc = Center of(Location 1)
Move unit to (TempLoc)
call RemoveLocation(udg_TempLoc)
after than you can set another point to TempLoc without memory leaks.