Irregular transpose of data based on groups of questions -- 2

Job ID: 35242848

Budget: £10 – £20 GBP

I need Google sheets data which is updated by Google form submission organised. Using app scripts or code, I need the solution to be dynamic and update automatically every time a new form entry is submitted. I have included a tab with my desired outcome

Google sheet in question:

https://docs.google.com/spreadsheets/d/1EUGTnlK4XdDxuo1Da2XGBNPs6iEAyqh7cdYmrTVBW5I/edit?usp=sharing

An explanation of how it's completed would be awesome!
Related categories: JavaScript Python Google Spreadsheets