Yes you can make your script ping noises when it logs out. You can probably even get it to send text messages or emails too.
Of course you'd have to custom code this all into your script and use -norandoms to override the login handler so you can get notified.
Instead of doing patchwork to fix your problem, it may be better to just directly fix the problem and find the root cause of why your accounts do not log back in after lagging out.