A patter we use freuqnetly to discover this is like so:
localnodes = search(:node, "tags:somequalifier AND chef_environment:#{node.chef_environment}"
This will find any nodes with the somequalifier tag as well as if they are in the same environment as the local node.
To switch to your method, it would look something like this:
----
if node.chef_environment == "ome-alpha"
local_environment = "alpha"
else
local_environment = "prod"
end
application_nodes = search(:node, "tags:#{node['memcached']['memcached_instance']} AND chef_environment:#{local_environment}")
...
----
I think the method I show above is a little simpler, as it removes the conditional lookup, and will scale with any amount of environments.