How to determine if a script is started by cron?
You may check your $_SERVER globals in the script. 

A better way, I think, would be to pass a parameter with your call to the script that separates the caller (I.e when you call it from the HOOK_cron(), add a myFunc(..., $caller="cron") to your call. And declare myFunc(..., $caller=null) as default parameter.

If this is not possible, you may set a session variable in HOOK_cron and check that in your script.