Well, it's easy to put the names into an array and then you could easily get the name of the terrain with an expression like:
That doesn't change the fact that now your gameplay system still does not know the specifics of each terrain field, so you still need to save that data somewhere, either hard code it into the events or (better) put the data into an array... perhaps in the array you now are already using.
So if you only have the speed and defense modifiers, you could easily store the name of the terrain at y-index 0, the speedmodifier at y-index 1, the defense modifier at y-index 2.
and let's say you wanna use your event exampel, then you could write it like:
Compare Tile At (X,Y):
* terrain_type = array.at(tile_ID, 0)
* terrain_speed = array.at(tile_ID, 1)
* terrain_defense = array.at(tile_ID, 2)
If you don't know how to use array... there is plenty of topics, tutorials and the manual, where you can learn how to use them.