For one, you have an extra set of parentheses around the body of the function. Parenthetical expressions like
(expr1 expr2 expr3 ...)
by default will evaluate expr1 and try to call it with the arguments expr2, expr3, .... E.g.,
arc> (+ 1 2 3)
6
This sort of rule applies recursively, so
((if (> 1 2) - +) 1 2 3)
first evaluates
(if (> 1 2) - +)
which returns the function + (since (> 1 2) is false), meaning the original evaluates to
(+ 1 2 3)
There are a few places where parenthetical expressions don't evaluate this way, but they're usually pretty obvious -- like the argument list in a def. For more details, the tutorial is a decent place to start learning about Arc & Lisp programming: http://ycombinator.com/arc/tut.txt.
To fix your code immediately, you'd just need to get rid of the extra parens. Expressions in the body of a function evaluate one after the other, returning the value of the last expression, so given
(def f (x)
(+ x 1)
(+ x 2))
a call to f will calculate (+ x 1) and (+ x 2), returning the latter.
But you should (generally) only use = for global variables. For local ones, you'll want with or let.
arc> (let x 1 (+ x 1))
2
arc> (with (x 1 y 2) (+ x y))
3