A resistor is not necessary if I understood your application correctly but post a schematic to remove any ambiguity.
And also, can I use the same digital pin to blink the LED and at the same time output the square wave?
Yes with the caveat output the square wave to what?