You can use that method( [GEAR dependant boost contro] for N20 controlling(if you have PWM value for nitro). You can use N20 settings.
for enabling relay that give power to solenoid only when button for N20 is pressed(nitro button connect to analog ch 7).
Wizzard of NOS recommend 50Hz for solenoid, but 61Hz is good.
For retarding spark, depending on engine and amount of nitro. Good starting point is to remove 2deg of ignition for every 20HP of nitro for 1 liter of engine. So if you have 100HP nitro shoot and 2liter engine you need to remove about 5deg of ignition(2*(100HP/(20HP*2 liter)). It's recommanded to check if engine knocks and go to dyno.
Example of table for fwd car with lot of nitro:
Amount of nitro for that car limited by traction in lower gears and with max of torque, so at lower rpm engine can suffer less nitro.