In your script:
# store the Process ID here
pidfile=/var/run/mypid.local
# If there's a stored PID, terminate with SIGKILL
[[ -f $pidfile ]] && kill -s 9 $(cat $pidfile)
# Save our PID for the next run to kill
echo "$$" >$pidfile
and, to clean up, just before you exit,
rm $pidfile