The source current is rated at 4 mA. I doubt if going beyond that would damage the TTP223. What would most likely happen is that the output voltage would reduce a lot as the current increased.
An LED in series with 150 Ohms will take about 20 mA from 5 V. A 500 Ohm potentiometer will take about 10 mA, so with both of those you would be taking 30 mA.
The best information that I had was that the output was rated at 4 mA. That doesn't mean that anything beyond 4 mA is impossible or harmful. It just means that the 4 mA is a guaranteed figure. The 4 mA rating was at 3.3 V supply, I think, so there could be a lot more current available at 5 V. There could be different versions of the TTP233.
If your circuit was working with the LED and the 500 Ohm potentiometer connected to the ttp233, you probably don't need to change anything.
On the formula, you still need to calculate the series resistance to get the current that you want in the LED. However, with an emitter-follower, there is an extra voltage drop of Vbe of the transistor, around 0.7 V, so you should use Rs = (Vs - Vbe - Vf) / i
The formula was ignoring the On-resistance, and therefore ignoring any other voltage drop than the LED, which is fine in many cases, but not where there is an emitter follower.