The basic strategy is to only check to the east, south, southeast and southwest. By checking those we are implicitly checking north, west, northwest and northeast.
First note that we can parse the data into a reasonable data structure (array of arrays) with a single line of understandable code.
The rest is straight forward. For each number get the product of the surround numbers (checking boundaries) and add it to the list of all products. Then just grab the item in with the max value.