With a new chip, you only need to burn the bootloader one time, you do that to set the fuses for correct operation.
You can set the fuses with Atmel Studio also, I used to do that for 1284 chips. Eventually I got tired of the really long time it took for Atmel Studio to start and now I use the Arduino IDE & load the bootloader to set the fuses. It takes a little longer to run, but not nearly as long as Atmel Studio took to start up.
Once the fuses are set, they're set.
The pins being used and their mapping are set from within pins_arduino.h. When the sketch compiles, it uses the information from that file, so it should be included in the .hex file you are downloading.
If the pin isn't working, check the soldering of the board. Perhaps the pin is not soldered and not making contact. You can use a small wooden stick and try pushing it down gently while the sketch runs, see if the output starts changing.