If i understand you want to write a script (and choose php probably because your familiar with its syntax) and you need it to run every X minutes.
Problem is that when you write a web site with PHP you can pass information using HTTP methods (get/post) and using the session
when running a script on a machine you don't have the HTTP traffic and no session (this can be simulated but its a bit complicated)
my suggestion is :
1) combine all the php files into 1 long php file that will be running (this way you can work with variables in the script with no problem) - you can copy past your code into 1 php file and you can include the needed files in your script so you can stile keep the original files
2) add a cron job (if its a Linux system) - http://www.cyberciti.biz/faq/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses/ - this way your script with run every X time (your choice)