It fails because _vehicle exists in one script but not the other, using _ in front of a variable makes it only work in the current script/scope.
You will need to pass the information about the vehicle to the other script.
Change addaction to the following in file 1
_action = player addAction ["Repair Provisionally","scripts\repair.sqf",_vehicle];
and then in file 2
at the top of the code
_vehicle = _this select 3;
it should now be defined.
Also it would be better to copy and paste your script otherwise anyone who tries to help may have to retype every line of code to test it if it's not an obvious fix.