How it works is that if you get hurt, it will automatically delete itself, and you would use "<ECJ" to check if it exists (If it doesn't exist, you have taken damage, if it does, you have perfected the map).
The original games does this, and then uses the ANP to start generating.