Not too hard of a concept, but the execution will take some work on your part.
Trigger 'loadevent' flag on every map, and when loading set a character variable indicating that the character has been to the map.
Before warping, check if the variable is set for the destination map.
The first part could be relatively efficiently accomplished with an SQL table, since you don't want to store tons of permanent character variables. My suggestion:
Store an array of temporary character variables consisting of loaded map names OnPCLoadMapEvent.
Query the array into an SQL table OnPCLogoutEvent, so that you only need to run this operation once.
The other way is, of course, to use a table of map indexes and potentially write an algorithm to fit all loaded maps into a single permanent character string variable, but I personally wouldn't go through that much effort for this.