Well, "on an in-out basis" sounds extremely bad english to me, even as a non-native. But wtfdik...
If the aim is to translate into equivalently deficient Spanish then "un referéndum sobre dentro/fuera", but I'd much prefer to read "un referéndum para elegir entre permanecer o salir" (de la Unión Europea) (or wherever else)