Personally have those messages filtered out, so wouldn't bother me.
And sorry I haven't read your code yet, so made some assumptions and kept the above simple.
You'd need to have check for:
1. Crash vs leaver (I believe this can be picked up from chat)
2. Stop if invite is declined (in addition to past displaytimer)
3. User adjustable AUTOINVITES variable (this could either be an int for seconds between each invite, or an int for number of autoinvites split evenly across DISPLAYTIME, e.g. if DISPLAYTIME=180s and AUTOINVITES=3, it'd send one /invite every 60s)
4. Able to handling multiple players crashing at the same time.