checking if office 365 user exists
There is no need to use the script to check user existence in Microsoft 365. If the user exists, they will just get the license assigned. If not, the account will be created and the license assigned.
logging in scheduled scripts
You will not see any messages from your script in log records as executing scheduled tasks logging is disabled out of the box. This is done specifically because in other case there will be a log record for each task launch for each object no matter if any actions are actually executed.