Looking for help with a project

We have a project where we require to have the IO ports Status on a Screen.

We want the following to happen:

1 - When IO is open Screen Color is Green and IO no is showing text 'EStop OK'
2 - When IO is closed Screen Color is Red and IO no is showing text 'EStop Pressed'

We also want the user to be able to label the IO ports using an UP/DOWN/ENTER/BACK select switch.

We are using a Mega board with the following

GRAPHIC ST7565 NEGATIVE LCD (128X64) WITH RGB BACKLIGHT - ST7565 from ADAFRUIT
BREAKOUT BOARD FOR PCF8575 I2C EXPANDER

We are not sure of how to best achieve this and the code. Please could someone help.