Condition for checking the state of the I/O pin(dual filament run out sensor)

See Macro Creation Tutorial - #8 by mental
and
Example: Search Printer Objects

If your intention cannot be handled by a macro, then a change to the code base is necessary, which would require a willing developer to implement