Your question leaves a bit of guess work as to what you are trying to do. You you don't use $2 anywhere, so you just want to use that as a flag to decide to run grep in a different way? If so, use $# will tell you how many arguments were passed. To test if there are two of them, you could use (( $# = 2 )).
As Tom Fenech suggested, you have a syntax errors in your code. There should be a semicolon after the ] or then should be put on a new line. Also, I believe you need spaces after [ and before ]. So here's a guess of what you might have been trying to do:
if (( $# == 2 )); then
grep -i a -1 --color -E $1 *.*
else
grep -i --color -E $1 *.*
fi