Welcome to the forum!
You are doing it wrong. You are creating InputPort on every run of your loop. It works first time, but every consecutive run it will throw the exception if previous instance of the port was not garbage collected. Creating of port in the loop like yours is not effective as well. think of it as a protection mechanism. If one part of your code is using a pin, if you try to use the same pin in other part of the code you’ll get an exception.
Take creation of the port out of the loop:
InputPort sensor = new InputPort((Cpu.Pin)FEZ_Pin.Digital.Di7, true, Port.ResistorMode.Disabled);
And yes, you can use A4 or A5 as digital pins as well.