I'm not sure your ultrasonic sensor is enough for that.
I mean you could do a simple approach like:
1) keep 50cm away from robot
2) when the robot see's your moving away (and the distance to obstacle increases to more the 50cm), it tries to catch up.
Very impracticable and useless I'm afraid.
Best thing you could do is use a camera and do image processing / object recognition. My thesis was on something similar, you might want to have a look here, for some image processing ideas:http://www.pocketmagic.net/?p=520
A better approach would be to use two PIR sensor, cheap and very reliable on day/night with a big radiu. You would need to mount them in the front part of your robot like:
Basically the angle can be adjusted for larger view but the idea is as follow:
1) the robot is still
2) you're moving in front of the robot, and the PIR sensors detect the movement, but the signal will be stronger to one of the sensors (corresponding to whether you're in the front-left part, or the front-right part)
3) the robot moves 1-2m (pre-programmed distance) and turns left or right as indicated by left or right sensor and then stops
4) goto 1)
alternatively you can use the ultrasonic sensor to replace the reprogrammed distance at step 3.