Can't you have a boolean variable attached in the first function and then make it false using the second function. Eg:
Script A -
bool AmActive = true;
void SomeFunction()
{
if(AmActive)
.... blah blah blah
}
Then in another script, you can make the bool AmActive as false.
Script B -
ScriptA.AmActive = false;
function SimilarFunction()
{
....
}
Of course you can use this to access other gameobjects. And the scripts using the GetComponent