My attempt at an answer (as I've said in the comments, I'm quite rusty... any corrections are appreciated)
We have $S_0 > 0$, and since we know $S_T$ we know $W_T = b$$\sigma \sqrt{T-t}W_T = b$ for some $b \in \mathbb{R}$.
Using the general case of Brownian bridge here, we have:
$$S_t | S_T = S_0e^{-\frac{\sigma^2t}{2} + \frac{bt}{T} + \sigma \sqrt{\frac{(T-t)t}{T}}z}$$
And we want $$E\Big(\int_0^T S_0e^{-\frac{\sigma^2t}{2} + \frac{bt}{T} + \sigma \sqrt{\frac{(T-t)t}{T}}z}dt\Big)$$
Using Fubini, this gives us
$$\int_0^TE\Big( S_0e^{-\frac{\sigma^2t}{2} + \frac{bt}{T} + \sigma \sqrt{\frac{(T-t)t}{T}}z}\Big)dt$$
We use the MGF of the normal to simplify the term in the expectation and we get $$E\Big( S_0e^{-\frac{\sigma^2t}{2} + \frac{bt}{T} + \sigma \sqrt{\frac{(T-t)t}{T}}z}\Big) = S_0e^{-\frac{\sigma^2t}{2} + \frac{bt}{T} + \frac{\sigma^2(T-t)t}{2T}}$$
meaning that the total term is
$$S_0\int_0^T e^{-\frac{\sigma^2t}{2} + \frac{bt}{T} + \frac{\sigma^2(T-t)t}{2T}}dt$$
which Wolfram gives me a nasty looking result for which contains error functions