There's a typically Thai answer to this queue problem.
I recently faced this queue on entry, and ask the security guy at the start of the queue if there was an alternative. He smiled, and pointed me to the VIP lane, which at the time was marked Chinese citizens only.
He explained you simply pay 200 baht.
You get a fast service with a smile in this lane.