I would be interested to know whether packets that you sent while the recipient was offline are sent spontaneously when the recipient comes back online, or are only sent when you try to send a subsequent packet to the same recipient.
I tested this and found that it only sends the buffered packets the next time it sends a subsequent packet to the same recipient. and also noticed that it would send all "undelivered" packets the next time it tries to send something whether some packets were destined for the receiving device or for other devices (with different IP addresses and port numbers). so if I try to send "Hi" to device 1 and "Hello" to device 2 and neither one is online, when one of the receiving devices comes online and it tries to send a new packet to it containing "What", it would send "HiHelloWhat". This behavior does not seem to change if the receiving devices comes online and sends a packet back first before it receives a subsequent packet.
My only reservation is that you are triggering it based on the return value from Udp.endPacket(), but the current documentation for the Ethernet library does not document a return value. If the library implementation you're using does actually provide a return value and it indicates that the packet was transmitted, you should be good to go. Does Udp.beginPacket() have a return value in your implementation?
Yes it has a return value even though Arduino website states that there is no return value. I am using the same implementation that was provided with Arduino 1.0.2 version of the IDE available on the website