I accidentally spun down the cells after heat shock treatment before adding the media into the tubes while doing transformation? will the transformation work?
This is hard to answer since we don't know the exact conditions you chose, as these are rotation speed (or better g), how long you spun them down and also if you used a cooled centrifuge or not. It's also important how gentle you resuspended the pellet.
However, I would plate these cells, no matter what happened since you are at the last step of the procedure and have nothing to loose. Do the usual dilutions you use for plating your cells and then add another plate with undiluted transformation mix. If you have only very few surviving cells after your mistake you might get your clones on this plate. If it doesn't work, you will have to repeat the transformation.
The question is following: did you incubate cells on ice before spinning? Protocol, for example this one for $DH5\alpha$, calls for just 10 minute incubation after heat shock:
Heat shock at exactly 42°C for exactly 30 seconds. Do not mix. Place on ice for 5 minutes. Do not mix. Pipette 950 µl of room temperature SOC into the mixture.
Did you centrifuge your tubes after step in bold? My bet is that spinning cells down (taking into account what @chris wrote about centrifugation parameters) will not dramatically decrease efficiency of transformation. DNA should be already in cells after step, highlighted in the quote.