auto_action: try to find the best wanted behavior

currently uses 'action' only if one result is available or if the
pattern matches exactly