Programming a Microcontroller - JTAG and SWD
I will try to answer the questions.
Question 1:
Per Default the Controller will initialize the Debugging Port (after reset) into JTAG Mode. If you want to use SWD you will have to apply the command Sequence mentioned in the Reference Manual Ch. 56.3.1 on p. 1968.
So the Selection is neither done in HW nor in the programming file. You (maybe) should be able to select the programming mode in your flashing tool.
Question 2:
J-Flash supports the following Motorola S file formats: .mot, .srec, .s, .s19, .s28, .s37
Therefor you should be able to flash your firmware generated by your toolchain.
Question 3:
Debugging is disabled when the Controller is in low power mode or &quot;Security&quot; is enabled (see Ch. 56.15 on p. 1978). So make sure both is not the case. For flashing you will have to keep RESET low for a certain time. More information can be found in the following Application mode: https://www.nxp.com/docs/en/application-note/AN12130.pdf
But you do not need to do this manually. This will be done by the J-LINK/J-Flash application. But you will need to make sure that your J-Link has control over the Reset line (connect the Reset Pin to the appropriate Pin on the JTAG/SWD Connector).
The Pinout for the SWD/JTAG Connector should look like the following:

Connection on the Controller should look like the following. I have highlighted the relevant Pins on the shematic for 32K118:

In the example above only the SWD lines are connected to the 32K118. But you can of course also attach the other 2 lines for JTAG. The important thing which maybe are missing is the Reset line for the J-Link. Or is RESET_MC1 connected to the Debug Connector? Maybe you could post the shematic for the Debug Connector.