You can create a "real" list of all the vlans that this range-list contains.
Once that is done it's trivial to do your check:
---
- hosts: localhost
connection: local
gather_facts: no
vars:
vlan_range:
"1,134,170,175,540,605,819-820,911-912,930-932,945,952,955,959-960,1200-1201,1400"
tasks:
- set_fact:
vlans: "{{ vlans|default([]) |
union(lookup('sequence', item.split('-')|first + '-' +
item.split('-')|last + ':%04d', wantlist=True ) |
map('int')|list) }}"
loop: "{{ vlan_range.split(',') }}"
- debug: var=vlans
- debug:
msg: "Found!"
when: "931 in vlans"