It's because the naked ' in your replacement string is actually terminating the sed command, meaning the shell is trying to process the line. This actually became immediately obvious when Benoit's edit caused your question to syntax-colour correctly. You can see the second ' on the line (the first character of the substitution text) changed the colour from red to black due to the string termination.
In addition, sed won't like the use of naked [] since they indicate character classes in regular expressions.
You can fix both problems with:
pax> find input.txt -exec sed 's/{a\[$1\]=a\[$1\]FS$2}END{for(i in a) print i,a\[i\]}/\x27{a[$1]=a[$1]FS$2}END{for(i in a) print i,a[i]}\x27/g' {} \;
which outputs:
'{a[$1]=a[$1]FS$2}END{for(i in a) print i,a[i]}'
So basically, escape the square brackets in the search string so they're treated as literals and use \x27 in the replacement string instead of '.