If pre_mean and post_mean are plugged into the likelihood, then the deterministic diff_of_means will be equivalent to post-processing the trace and calculating the distribution of the difference.
Sort but not really? The model code is used to construct a computational graph, but no computations are actually performed as the lines of python inside the model context are executed. The computations are performed (by pushing data through the computational graph) when you call pm.sample() or pm.prior_predictive(), etc.
So as (I think) I said above, pre_mean and post_mean are (or should be) connected to the data in those 2 likelihoods. These lines:
pre_mean = pm.Normal("pre_mean", mu=pre_mu, sd=pre_sd)
post_mean = pm.Normal("post_mean", mu=post_mu, sd=post_sd)
specify the prior for these parameters. The posterior is in the trace.
Apologies if I am either not answer your question or rehashing things from above. Like I said, this thread is long forgotten.