I'm guessing that the difficulty is because you want this to happen in a collision, and yield isn't allowed in collisions. What you need to do is something like:
In the collision:
- set the color of the agent to something, maybe red or blue, to indicate that it is about to die (if the agent's shape has a "skin" you won't see this difference, so it's just an internal marker)
In the main forever code for that breed:
- if color = red (or whatever you use) then
- repeat 10 (or some number)
- forward 1
- yield
- (you might want add another repeat/yield loop here with something other than movement, like a say block or something)
- die
Does this help?