variating an ouput over time

Joes:
i was using the switch to trigger the process for example when the switch goes high it will slowly increase the pin over the duration the one pot is set to and to the maximum point the other pot is set to when that point has reached it will stay there until the switch goes low and then it will wind back down to 0 over the period of time the pot is set at

OK, I think I understand what you want now.

You need to read the switch state repeatedly until it changes. When it changes, read the analog pots to establish the timing and maximum level settings.

Hard-code the relationship between the timing pot and the time interval between adjusting the output value.

Each time the time interval passes, adjust the output value. The new output value will be determined by multiplying the proportion of the time that has passed, and the maximum level. This will give you a duty cycle which you output by doing an analog write.

For what it's worth, I suggest you continue to monitor the switch and reverse the direction if the switch is changed during this process - just because systems that lock up and won't allow you to interrupt what they're doing irritate me.