My friend Amber asked me what to do with Basil that looks long, leggy and flowery. I suppose like this:
Well, my answer - cut it as hard as you like, use the leaves, keep feeding it and keep it moist.
Also put it somewhere that it'll stay warm. You can keep Basil going as far as mid July, but the cold WILL finish it. It'll go woody and die. So keep it under plastic or against a warm (west facing) wall.