Restart OS X if an application has crashed/is not responding/beachballed?
Replace Shalalalala with the name of the process you want to monitor.

property NameOfVictim : "Shalalalala"


tell application "System Events"
    set ps to get the name of every process

    repeat while ps contains NameOfVictim
        set ps to get the name of every process
    end repeat

    restart
end tell