You mean if the player stays close to the wall after the collision, it should be destroyed after 5 seconds? But if it moves further from the wall, it will not be destroyed?
You can pin another invisible sprite to the player, with slightly bigger collision polygon. When player collides with the wall, start a Timer "destroy" for 5 seconds.
On "destroy" Timer event - destroy the player.
If the timer "destroy" is running, but that invisible sprite is no longer overlapping the wall, stop the "destroy" timer.