Try like this create a collection of prompt using the Update data block and use expression like below in the custom expression place.
You will store the prompts in the collection and then use that in the custom expression

If(Flow.SSNorPINCountREE == 1 and Task.GetSSNorPINLoop == 0, Flow.GetSSNOrPinPrompts[3],
If(Task.GetSSNorPINLoop == 1, Flow.GetSSNOrPinPrompts[1],
If(Task.GetSSNorPINLoop == 2, Flow.GetSSNOrPinPrompts[2], Flow.GetSSNOrPinPrompts[0])))
------------------------------
Thanks!
Ganesh S
------------------------------