I had a quick look with FlyWithLua...
When you set the dataref to "0" you will get a single click, so there is no need to set it to "1" and then back to "0". I reliably get only one key press using this method. So in theory what you're doing should work.
I assume that it's the way Air Manager handles things... maybe you should also post this question on the Air Manager support forum and see if someone can assist you.