About the complement & the necessity of your first line (telling each client to make all turtles hidden)
First, what I'm assuming... 1) each turtle in the model is associated with a hubnet client (a student) 2) there are no other turtles or kinds of turtles in the model. 3) the agentset "turtlesicansee" is a turtle variable that changes over time
Given these assumptions, one way to get the complement of turtlesicansee is
let onesicantsee turtles with [ not member? self turtlesicansee ]
This would create a temporary variable with the complement of turtlesicansee.
So, you could do your two commands with less redundancy by saying:
ask turtles[
let onesicantsee turtles with [ not member? self turtlesicansee ]
hubnet-send-override user-id turtlesicansee "hidden?" [false]
hubnet-send-override user-id onesicantsee "hidden?" [true]
]
HOWEVER, setting the override on a client (at least in my understanding/mental model of things) isn't expensive. It doesn't actually cause something to happen, it sets a "filter" on the next display update. So, your original code isn't so bad. You need to manipulate the filter's behavior for all turtles, and your approach may actually be faster than the one that I've written here.
On the question of the "logic" of HubNet's command here, and your "Part of what's confusing me..." note. I agree, this is very bizarre. The "hubnet-send-override" command could be issued outside of an ask-turtles block. But in this case (and in most cases) you need to personalize the "filter" to each turtle (student) by using their user-id and their turtlesicansee variables. So, doing the command inside an ask turtles sets the scope of those variables to each student, in turn. [Does that make sense?]