heya, try something like
Code:
SOUND* snd_tankidle = ".wav"; //enter soundfile name here
var hnd_tankidle; //handle for playing soundfile

function toggle_engine(){
	
	//toggle to the new state
	engine_state = 1 - engine_state;
	
	//if engine is now on
	if(engine_state){
		hnd_tankidle = ent_playloop(panzer, snd_tankidle, 77);
		
	//if engine is now off
	}else{
		snd_stop(hnd_tankidle);
	}
}
//....

void main(){
	key_e = toggle_engine;
}
this is untested but will show you the use of sounds and handles

if this keeps switching on and off while you're pressing 'e', it'll be something inside you action, posting that code may help

hope this helps