I had a similar issue and founf the easiest way was to add an include statent in either the loop of in the particular template where you want the variables from another php file to work.
For instance, I have a non WP script that displays photos from another php script.
Let’s call the other script other.php
I first created a template file by copying source code from my single.php file in my theme.
<?php
/*
Template Name: My_Modified_Template
*/
?>
<?php include (TEMPLATEPATH . '/header.php'); ?>
<?php include ('other.php'); ?>
Of course the location of ‘other.php’ above is relevant to the root of the domain and my WP install is also in the root, so you’d need to change:
<?php include ('other.php'); ?>
to the location of your file so perhaps if your file is in /scripts then the include statement would be:
<?php include ('/scripts/other.php'); ?>
Perhpas this will work, depending on the type of outside php script you are running.
V.