Firstly, thanks for name-checking the Gist - glad someone is using it!
I think what you're describing is built into how Lync works - this 30 second is something you see even if you send it from another Lync client, if you ignore the popup the message is still delivered after that time.
I think the reason for it is that you might be signed in on many different devices (different endpoints). Lync will signal your message to all endpoints and wait to see what you do. If you accept the message on a specific endpoint, then all future messages for that conversation will go there. However, if you ignore it, eventually the Lync client will auto-accept your message anyway.
This behaviour was (if I recall) subtly different in Lync 2010, where the client would automatically accept the message immediately when showing the popup.
What's happening when you leave the conversation window open and re-run the app is that you're getting stuck between two things. The first thing is that you're creating a brand-new conversation, with a new conversation ID etc etc. The Lync client is doing its "ah, new conversation, lets wait and see if other endpoints pick it up". At the same time however, the Lync client is "clever" enough to guess that you probably don't mean to have two conversations with the same recipient, and is grouping together your conversations into one window. That's why you don't get the popup (Lync client grouping your conversation) but do get the delay (Lync client handling new conversations), and then the message arriving in the same window.(Lync client grouping your conversation).
It's a particular edge case which the client doesn't deal particularly well with, but I don't think there is any nice way of fixing it.