It will keep waiting for that device to connect and the moment it does, at any time during that 30 day period once the message has been sent, it will deliver all messages sent to that device and sitting in the queue.
At this point, the status of your phone has nothing to do with it - the minute you hit send when you were connected to the internet, it was uploaded to Apple's iMessage system. Now, it is purely a matter of the recipient device connecting to the internet at some point within 30 days of you sending it. When it does, any and all undelivered messages sent to it within the past 30 days will be delivered.
But once you hit send, and the message is sent off to Apple's servers, your device can be vaporized and it won't affect the delivery of that message at all.