TP4056 & resistor at VCC
If you leave out the resistor and charge a battery with 1A (maximum current that the TP4056 can do) then the TP4056 will have to dissipate: 5.0 V - 4.0 V = 1.0 V * 1 A = 1 Watt (I'm assuming about 50% battery charge so 4.0 V). That's a lot for such a small SOP package and the TP4056 will get quite hot.

If it gets too hot it will lower the current but then your battery will charge slower.

This is where the 0.4 ohm resistor comes in, it will drop 1 A * 0.4 ohms = 0.4 V. That means the TP4056 will now only need to drop 0.6 V. At 1 A that means 0.4 W is dissipated by the resistor and " only" 0.6 W needs to be dissipated by the TP4056. This might be just low enough for it not to become too hot.

So if you are going to charge your battery with about 0.5 A to 1 A, then I would add the resistor.

If you're going to charge your battery with less than 0.5 A you can probably safely leave out the resistor.

Oh the dashed rectangle: it means that this resistor will get slightly hot and to cool it it is advised to keep other components out of the way and using somewhat larger copper areas on the PCB connecting to the resistor is advised as that helps to keep it cool.