Well, I'm kinda confused on what file your trying to test for.
If its a file within your addon folder, simply make sure it gets called before the one that needs it in the .toc (or .xml <Script />)
if its a file from another addon, in your .toc add # Dependencies: OtherAddon
and that addon (and its associated files) will be loaded first.
also
Code:
local bool, retVal1, retVal2, reValn = pcall(someFunc, param1, param2, paramn)
if bool then
--function was a success,
else
--function threw an error :(
end