My (shorthand) one is:
accel = 0.001
deccel = 0.001
control = righty
thrust = 5000
@speed=0.5 if @speed==nil
@speed-=deccel if @speed>control && @speed>0.5
@speed+=deccel if @speed<control && @speed<0.5
@speed+=accel if control>0.5
@speed-=accel if control<0.5
@speed+=deccel if control==0.5 && @speed<0.5
@speed-=deccel if control==0.5 && @speed>0.5
setVar("speed",(0.5-@speed)*thrust)
Essentially, you just need to stick the script in onTick (doesn't matter where), and getVar("speed") in the thruster field. At the top of the script, you can change the rate of acceleration and decceleration, the controller (leftx, lefty, rightx, etc...), and the thrust multiplier (how much thrust you want overall).
This script is shortened and simplified from my original version, slightly modified for use with a thruster. However, I'm really not sure you'll get the result you want...