Script Name: ReturnFlag(Team : byte)
Script Description: Returns a Flag to its spawn position. Team determines which team's flag is returned:
   1 = Alpha Flag
   2 = Bravo Flag
   3 = Point Match Flag
Original Author(s): J-Factor
Core Version: 2.6.3
Code:procedure ReturnFlag(Team : byte);
var n, i : byte;
begin
  n := SpawnObject(0, 0, 1);
  KillObject(n);
  for i := 1 to n - 1 do begin
    if (GetObjectStat(i, 'Style') = Team) then begin
      KillObject(i);
      break;
    end;
  end;
end;
Colour formatted and commented version:
http://nopaste.org/p/acAMPZDTlZip archive attached.
Notes: It's a pretty simple code snippet, but quite helpful. This even works if someone is holding the flag!