I got a Testscript with more than 8 Webdriver-Sampler and a variable, which change in some of the Webdriver-Sampler.
For Example:
First Sampler:
You can access JMeterVariables class instance via JMeterContext.getVariables() method like:
var vars = org.apache.jmeter.threads.JMeterContextService.getContext().getVariables()
vars.put('foo','bar')
var foo = vars.get('foo')
//etc
See The WebDriver Sampler: Your Top 10 Questions Answered guide for more WebDriver Sampler tips and tricks