How to use this logic with awk?

Hi friends, I am having 2 files, I just want to compare 2 files each containing 2 columns 1st column is lat, and 2nd column is long, if anyone can understand below logic please help me in writing script with awk.. here each field of file2 needs to be compared with std_file

main
counter=0
counter1=0
back
if(lat(file2) is greater or equal to lat(std_file)-0.1 AND lat(file2) is less that or equal to lat(std_file)+1)
then
if(lon(std_file) is greater than or equal to long(file2))then
counter = counter+1
end if
if(lon(std_file) is less than or equal to long(file2))then
counter2 = counter2+1
end if
end if
go back
end if
if(counter is greater than 1 AND counter2 is greater than 1)then
write  "lat value of file2"  "long value file 2" and print "inside"
else
write  "lat value of file 2"  "long value of file 2" and print "outside"
go main

There are alot of threads here in the forum about how to separate two files, especially with awk. Use the search functions first and also show what you have tried, thanks.