Well, first thing's first, unfortunately, JavaScript does not support multi-dimensional arrays. However, this is easy to fix, because
technically, there's no such thing as a multi-dimensional array, and languages that appear to support it just do a little extra math behind the scenes to make it seem like it exists. The formula for the index in a two dimensional array (assuming we're using x for width and y for height) is:
var index = (y * height) + x;
Now that that's out of the way, where to put the variable depends on several things. What is going to need to access this array of walked-over tiles? What do you intend to use it for? Is it safe for any object with access to be able to change the array, or are there only a few spots that should be able to edit the values to ensure everything is valid?
Since you say you want to add it to the map, and I assume this may just be part of a learning exercise, or perhaps some kind of system you're working on to familiarize yourself with MV, we don't really need to go through a whole list of scenarios, because I'm assuming this is mostly designed as a learning experience. Personally, since your array will be based on
the current map, I'd recommend putting it in Game_Map, which is re-setup (i.e. the
setup function is called) for each map that's loaded. By putting the array in there, with the code to set it up, you're pretty much guaranteed that it'll apply to the current map.
If you haven't already seen it, I highly recommend that when you're developing plugins or changing the code for the engine to better fit your game, that you have the rpg_* files split up by class, as looking through the smaller files that are organized by name is significantly less intimidating than looking through five or six files of 10,000+ lines of code. I maintain a list of spit files for almost every version of RPG Maker MV (I think I missed 1.3.2 because it was short-lived or something)
in this topic.