Learn scripting standards, I fixed it up a bit but it's not perfect. I commented where I fixed stuff, not sure if it's all good now though.
It's getting an Identifier Expected error now though, Idk how to fix 
SCAR Code:
program GuardFighterZero;
{.Include SRL/SRL.Scar}
{
________ .___
/ _____/ __ _______ _______ __| _/
/ \ ___| | \__ \\_ __ \/ __ |
\ \_\ \ | // __ \| | \/ /_/ |
\______ /____/(____ /__| \____ |
\/ \/ \/
___________.__ .__ __ __________
\_ _____/|__| ____ | |___/ |_ ___________ \____ /___________ ____
| __) | |/ ___\| | \ __\/ __ \_ __ \ / // __ \_ __ \/ _ \
| \ | / /_/ > Y \ | \ ___/| | \/ / /\ ___/| | \( <_> )
\___ / |__\___ /|___| /__| \___ >__| /_______ \___ >__| \____/
\/ /_____/ \/ \/ \/ \/
}
{Version : Zero}
{Next Version: One}
const
GuardType = 'varrock';//The city you are fighting guards in: varrock, ardougne.
var
GuardV, GuardA : Integer;
X, Y : Integer;
procedure DeclareGuardType(CityGuardType : String);
begin
case LowerCase(CityGuardType) of
'varrock': GuardV := 7111560;
'ardougne': GuardA := 9770770;
end;
end;
function AttackGuard(Guard : String) : Boolean;
begin
if(not(LoggedIn))then Exit;
//You had an extra begin there
case LowerCase(Guard) of
'varrock': begin
if(FindObj(X, Y, 'uard', GuardV, 5))then
begin
MMouse(X, Y, 1, 1);
if(IsUpText('uard'))then
begin
Mouse(X, Y, 1, 1, True);
Result:=True;
end else
begin
Result:=False; //Put this in here for false
end;
end;
end;
'ardougne': begin
if(FindObj(X, Y, 'uard', GuardV, 5))then
begin
MMouse(X, Y, 1, 1);
if(IsUpText('uard'))then
begin
Mouse(X, Y, 1, 1, True);
Result:=True;
end else
begin
Result:=False; //put this in here for false
end;
end;
end;
end;
end; //That's the end for the AttackGaurd Function
{ end else //These next four lines aren't part of any procedure :\
Result:=False;
end;
end; }
procedure Fight;
var GFT : Integer;
begin
if(not(LoggedIn))then Exit;
GFT := 0;
repeat
AttackGuard(GuardType);
GFT := GFT + 1;
until(AttackGuard(GuardType)or(GFT >= 7)); //you were missing a ) there (on the end)
if(GFT >= 7)then
begin
WriteLn('Could not attack/find guards, terminating scrpt.');
TerminateScript;
end;
end;
begin
SetUpSRL;
DeclareGuardType(GuardType);
begin
Fight;
//no end; there, you only need end. for end of MainLoop
end.
EDIT: ops didn't see that ducels beat me to it