Irregular transpose of data based on groups of questions

Job ID: 35184813

Budget: £10 – £20 GBP

I need Google sheets data which is updated by Google form submission organised. Using either a formula or app scripts, I need the solution to be dynamic and repeat successfully every time a form 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 Data Entry Excel Google Sheets Spreadsheets