Login and wake from sleep seems to be two different things.
Don't know much about Apple script. Maybe you can create a script to monitor the state of SMB connection. And immediately reconnect once connection is lost.
My experience is, I can stack very high system uptime using sleep, when not using computer, but not entirely log out. Kinda hard to explain but you may get the idea.