awk '
NR==FNR {
a[$1,$2] = $3
val[$1,$2] = $4
next
}
($1,$2) in a {
for (n=$3-2; n<=$3+2; n++)
if (a[$1,$2] == n) {
$4+=val[$1,$2]
break
}
}
{print}
' file2 file1
AT1 AT22 24 2 ATAGATA ATTATAT
AT2 AT24 22 0 ATAGATA ATTATAT
AT3 AT23 263 4 ATAGATA ATTATAT
AT4 AT28 252 7 ATAGATA ATTATAT