That is correct. The physical system console session can remain in an unlocked state, and while unlocked, the SendKey*() and Mouse*() functions will work properly.
There is absolutely no ambiguity involved with how these functions behave w/respect to unlocked sessions and locked/disconnected sessions. The only variable involved is what state the session is actually in at any given time, which may not be obvious and is implied by how these functions are behaving at any given time.
If the script will be running in a session that has any possibility of going into a locked or disconnected state, then the script needs to be rewritten to not use the SendKey*(), Mouse*() or any other functions that do not function in a locked/disconnected session.