Sounds like a cool experiment, you could try different resistors (or one variable reistor) under the same lighting conditions, and see how far above a black/white line you can detect the change (i.e. the phototransistor reliably trips the input on whatever device you want to use the sensor on). You probably want to be well on the working side (a few milliamps) of when you start missing lines at the height your line-following robot is going to use.
By the way, a quick note on data sheet terminology. 50mA is the current listed in the “Absolute Maximum Ratings” table. These are not normal operational values, these are the maximum values at which the manufacturer guarantees the device won’t instantly die (like: oops I hooked it up wrong-POOF), but you’re also not guaranteed any significant runtime at those values: “stressing the parts to these levels is not recommended”. If you notice, most of the ratings in the normal table are computed with 20mA, which is probably just fine for normal operation (but that’s what you’re going to figure out!).
I guess what I’m saying is you probably don’t want to start at 50mA, or maybe start at the lowest current and work your way up, so you know your later results aren’t being affected by any damage from your initial tests.
Also, when calculating the current an LED will draw (or rather, what current a resistor will limit it to), the source voltage is generally not the voltage drop across the inline resistor. The diode also has a voltage drop across it, and just to make the math super-complicated, that voltage varies with current (Fig 1, Page 3 of the data sheet, it’s not even a nice straight line)! Typically you take the average value of VF (the diode’s forward voltage drop) at the expected current, in this case 1.7V at 20mA, from the top of the Electrical/Optical characteristics table.
So, I=(Vs-VF)/R =(5V-1.7V)/100ohm=33ma
Which means 270 and 330 ohm resistors are underpowering the LED by even more! Then again, maybe that’s just fine. If you really wanted to you could measure the current during your experiments, but this standard formula is probably sufficient, since you’re interested in relating performance to resistor value, not trying to precisely reach a particular current. Anyway, good luck with your experiments (and your line follower), and please post your results!
-Adam