Loiter function after serial port trigger


Is it possible to initiate the loiter function after a trigger (minus sign) sent from a serial port input; then loiter for a set interval; then continue on the mission where it left off? I am attempting to plan a mission based on turns and transects, but I would like to have the boat loiter if a sensor detection can be transmitted via a transmitted character. Please let me know if there is any method possible to do this.