Getting the nodequeue id from the nodequeue name?
There is a function of the same name as in the excepted answer included in current versions of the nodequeue module. 

$queue = nodequeue_load_queue_by_name($name);


It returns the queue definition, or an empty array if no queue was found with the given machine name. So the id would be found at:

$queue-&gt;qid;