There's no need to spend a night in Brussels, as it's only an hour from Bruges, with trains twice an hour connecting them. And the trains are unreserved, so you don't even need to plan ahead; whenever you're ready to leave Brussels, you can just take the next train back to Bruges.
To find flights between Brussels airport and Berlin, use Skyscanner: http://www.skyscanner.com/. Be aware that Brussels Airport (code BRU) is much easier to reach from Bruges than Brussels Charleroi Airport (code CRL). Berlin has two airports, and you probably don't have a reason to favor one; so, use the code BER to pull up "all Berlin airports." Looking at a random date in May, I see a number of nonstops from BRU, with prices starting at $66.
To find trains, use the Bahn (German Rail) website http://reiseauskunft.bahn.de/bin/query.exe/en following Rick's tutorial: http://www.ricksteves.com/travel-tips/transportation/trains/online-schedules. Your starting station is Bruges(B), and your ending station is Berlin Hbf. A quick look shows that the fastest routes are 8 hours with two changes. Some of the tickets can be bought in advance on that website at a discount, if you can live with tickets that have restrictions on refunds and exchanges.
As for which city to do first, I'd see which direction works out cheapest. For no clear reason, it may be much cheaper to go US to Berlin and Brussels to the US than the other way. Or, the one-way airfare between your two cities may be much lower in one direction on the day you want to go.
How many nights in each? That, of course depends on your goals. But Berlin is MUCH larger than Bruges. You could easily spend all 8 days in Berlin and not run out of "first tier" things to do, while Bruges's designated "sights" will only take 2 days or so. That doesn't mean Bruges isn't a nice place to relax, particularly in the evenings. And if you feel "done" with Bruges, you can take easy day trips to Antwerp or Ghent as well as Brussels.
The same thinking may influence which city you want to see first. Do you want to start in the small one to get acclimated, or leave the small one for later, to relax after the big city?
EDIT: cross posting with Nancy - I see great minds think alike.