I think there is no need for this approach. You should try this:
- Go to Form editor / Confirmations
- Create confirmation
- At the bottom of the screen you can find Conditional Logic, from there you can select specific field values.
- Set Confirmation Type as Redirect
Repeat process for all Confirmation options / redirects you need to offer.