Screen sharing turned off, but appears as "enabled"
Your shell script code is simply a check for the presence of the file /etc/com.apple.screensharing.agent.launchd.  If the file is present, it prints enabled, else it prints disabled.

However, this file is always present (in 10.13 and possibly under 10.12 as well) whether the screensharing agent is currently active or not.  Watchfiles in launchd are not necessarily checked for their presence or non-presence (unlike pidfiles in Linux, for example).  Changes and updates to the file can also trigger actions.

It's probably best to rely on launchctl's actual facilities for introspection, via sudo launchctl list or the newer launchctl print system commands, rather than checking for the presence of legacy files.