Having been to both Bali and Japan in the past year, I would recommend both. They are very different places though. Bali's nice as long as you choose the right area. Bear in mind parts of the island are quite the playground for Australians who can get there easily.
On balance though, I would rate Japan much higher in terms of a country to visit. It's utterly fascinating and a great country to visit. There's certainly plenty of nightlife in the major cities. If you wanted some beach time then you could always tag on Okinawa - the group of islands to the south of Japan main island.
I would have suggested tagging on a trip to Bali from Japan, but it's a long-haul flight - flight time from Tokyo to Denpasar is 7.5 hours. Depending on where you're starting from and/or whether you can build a multi-point trip easily, I'm not sure I'd go so far out of the way for that.