However I am sure it would work fine with a combination of ping / ultrasound sensors and encoders on the wheels.
I don't think You need any of these as if You want robot to follow white line on black carpet, all You need is 2 IR emitter/detector pairs, no shaft encoders, no ultrasonic sensors.
As I'd imagine, in this case robot with 4 IR emitter/detector pairs would do (two at the front and at the back). When robot goes to one side, sensors at the front make sure that robot does not loose its path, where sensors at the back makes sure to detect when path finishes at on given side. Someone/something puts coffee on the robot and pushes the button, then sensors switch places in their functionality, now the back ones become front ones and and front ones become back ones. Robot goes to the other end of the line and stops. Someone drinks coffee. If more coffee is needed, person pushes the button and robot goes back to ask for some more.
P.S. You could have something like this
to make You coffee