I'm not totally sure I understand your problem. Is there a reason why you can't just create a single audio context at the top of your script and then have the rest of your code refer to it?
For the sake of providing an answer anyway, you could do something like this:
var getContext = function() {
var ac = null;
if ( !window.AudioContext && !window.webkitAudioContext ) {
console.warn('Web Audio API not supported in this browser');
} else {
ac = new ( window.AudioContext || window.webkitAudioContext )();
}
return function() {
return ac;
};
}();
Then, every time you need a context, you just call this function:
var ctx = getContext(),
osc = ctx.createOscillator();
osc.connect(ctx.destination);