How to use Variational Autoencoder's μ and σ with user-generated z?
If you are training a VAE the encoder is essentially parameterizing the variational posterior distribution of $z$ given $x$, i.e.
$$ q(z | x) = \prod_{i=1}^{N_z} q(z_i | x) = \prod_{i=1}^{N_z} \frac{1}{\sqrt{2\pi}\sigma_i(x)}  \exp \left[ -\frac{(z_i - \mu_i(x))^2}{2\sigma_i(x)^2} \right] $$
where $\mu_i(x)$ and $\sigma_i(x)$ are given by the encoder and $z$ is in the $N_z$-dimensional latent space. 
I would think of the problem as if the $x$ are parameters of a probability distribution and the $z$ are some observations you made.
The "nearest" encoding from your training data $x$ would be the encoding with the highest likelihood, i.e. you compute the likelihood for each data point for a given $z$ by evaluating the above expression and take the $x$ with the maxmal value.

The log-likelihood is usually used in these scenarios because it's more convenient, but it is equivalent, as the likelihood is non-negative and the log is a monotonic function.

In the comments you mentioned to use a distance metric. The log-likelihood provides a nice interpretation, because it gives you something similar to the negative euclidean distance between $\mu(x)$ and $z$, but scales and shifts by terms determined by the standard deviation:

$$ \log q(z|x) = \sum_{i=1}^{N_z} \log q(z_i|x) = \sum_{i=1}^{N_z} \left[ -\frac{(z_i - \mu_i(x))^2}{2\sigma_i(x)^2} - \log \left( \sqrt{2\pi}\sigma_i(x) \right) \right] $$

So intutively, by maximizing the (log-)likelihood, you are minimizing the euclidean distance between a given z and the encoding $\mu(x)$ of $x$ from the training data set, but you pay penalties for having large variances.

(Furthermore, if you do it this way, there is no sampling of $\epsilon$ required.)