It would depend mostly on what you mean by "cost". In Star Wars, construction occurs pretty much the way it does right now on earth - hulls are laid down, shipyard crews install additional components, eventually you have a functioning starship. Materials have to be manufactured and transported. Fuel costs are incurred, salaries are paid. In the case of the Death Star, Wookies were enslaved as construction workers, which seems inefficient, but does make the point that the Empire Is Bad.
If you were building a Matrioshka Brain or Jupiter Brain, first of all, normal construction rules probably wouldn't apply. Your best bet would be to create a Von Neumann machine whose directives specify a given number of replications, construction of the computer via disassembly of available materials, and then self-disassembly as the final stage in the construction. No logistics, no salaries. So no "traditional" cost.
However, you're going to use up the mass of a gas giant (or, in the matrioshka case, the mass of a solar system) and that mass can't be used for anything else. So depending on how that's priced, it could be "expensive". It's hard to imagine that a galaxy-spanning civilization wouldn't have an uninhabitable solar system to spare, however.
As for its utility, that would largely depend on the speed of communication. If you're limited by speed-of-light, the utility of such a construct would be sharply curtailed, because any calculation/simulation it could perform would be badly out of date by the time you found out about it. However, speed-of-light limitations would also make it difficult or nigh-impossible to maintain a galaxy-spanning civilization. So if we assume that you have FTL communication capacity, there are all sorts of applications to which an astonishing amount of computational power could be put.
Most notably, simulation. For things like protein folding and DNA modelling here on earth, we use massively parallel operations to speed the process along. Such a processor could do that trivially. Since you're clearly in the business of remodelling solar systems, you might need to do an orbital simulation with thousands or millions of orbiting bodies. No problem!
Additionally, assuming that true artificial intelligence is possible, you could simulate millions or billions of sophonts to do social simulations in compressed time, or to do actual original research. As we've discovered with big data, in some cases, computational quantity is a quality all its own.