Support for this already exists in UDMF maps using sector fields, and it is possible to (ab)use those fields in binary format maps (see 37993cde), it just needs to be linked and updated properly with the linedef action.