IF statement doesn't work properly in osascript
This way works:

#!/bin/bash
osascript -e do shell script \"

COUNT=0

while true;
do
    if (ps aux | grep Skype | grep -v grep &gt; /dev/null)
    then
        echo 'RUNNING' &gt; /Users/someuser/Desktop/RUNNING.txt
    else
        echo 'STOPPED' &gt; /Users/someuser/Desktop/STOPPED.txt
    fi

    sleep 1
    COUNT=$((COUNT+1))

    if (($COUNT &gt; 60))
    then
        exit 0
    fi

done
\" with administrator privileges



You don't need the quotes before do shell script, as this is an applescript sentence.
Avoid unnecessary double quotes to prevent errors.