You can put, let's say two towers attacking each other in a unreachable corner of every map. These towers should not be able to destroy each other under normal game conditions (for instance 100 health, 20 damage and a 100 hp regen per second).
Then, you create a trigger that checks whenever one of these units is destroyed. If they are, it means the player will have used whosyourdaddy (unless you used some trigger that damage every unit of a player or something), and then you can just defeat them or whatever you like.
There are probably other ways, but this should do the job.