Solution:
We can do casework based on the position of the knight: corner, edge, or center. In each case, we can quickly compute all 15 distances by writing a 1 down in all squares reachable from the original square, then writing a 2 down in all blank squares reachable from a square with a 1, writing a 3 down in all blank squares reachable from a square with a 2, and so on. The resulting tables are below:
The expectation can be computed by weighing the sum of the distances in each of these tables by the number of squares of that type:
16⋅151(4(2⋅1+5⋅2+4⋅3+2⋅4+2⋅5)+8(3⋅1+6⋅2+5⋅3+1⋅4)+4(4⋅1+5⋅2+4⋅3+2⋅4))=2401(168+272+136)=512