"Joy" does not appear in this passage, but Paul's purpose is to instruct us how to produce the sustained sense of well-being that should mark a Christian's life. When a person feels good about life, about who and what he is, what he is doing with his life, and where it is headed, a sense of joy is always present. Paul's instructions are timeless in producing this.
"Walk circumspectly" indicates keeping the commandments. Paul advises us to make the most profitable use of our time, considering the state of this world. He warns us not to be foolish, and always to consider, search for, and focus upon the purpose God is working out. Then in verse 18 he makes an interesting contrast that directly involves producing the joy that should accompany the life of anyone heeding these instructions.
The verse contains a play on words. It is no accident that alcohol is associated with "Spirit." Paul's counsel is not to seek joy in the sensuous, self-centered, worldly ways that produce dissipation or debauchery, but rather to be filled with the Spirit, singing and meditating on God's Word as we give thanks in all circumstances. This formula is guaranteed to produce a sustained sense of well-being because it removes the natural self-seeking from our lives and replaces it with a God-centered way of glorifying Him. This allows joy to be the fruit, the blessing of the Almighty, rather than the direct object of our pursuit.