Light dimmer circuit modified, have some questions
R6 is determined by the maximum current the opto can withstand if turned on at the peak of the cycle. It has little to nothing to do (directly) with the triac gate sensitivity- except that if you make the resistor large and the triac is insensitive it will not be able to turn on 100% and the output waveform will likely be significantly lopsided (DC content). Something like 220 ohms will be fine (but it should ideally be a flameproof type). 

The power dissipation will be very low because the triac turns on and shunts the resistor so little current flows through it. 250mW is fine. Unless the triac doesn't turn on (say a bit of solder shorts MT1 and gate) in which case the resistor will likely go up in flames with 200W+ dissipation assuming a low load resistance (refer to the final sentence in the above paragraph). 



Now, as far as R5 is concerned, 10mA maximum is fine (the GPIO output will not be 5V with 10mA being drawn, so it won't be quite 10mA) but you should specify the MOC3023 which is guaranteed to turn on with 5mA. If you really want to use a 3021 then you can add a transistor which will more reliably drive the opto.