Yes, this should work. A few things you may have already considered:
- Each time your cable goes into or out of a junction box you should plan to lose 6" in length.
Each time your cable goes into or out of a junction box you should plan to lose 6" in length.
So tying into and out of the ceiling box for the fan would require 12" of slack on the existing 4-wire cable. Your plan to add a separate junction box is a better approach. The trick is to put it at least 6" closer to the dual-wired receptacle and run 3-wire the longer distance to this box. When you tie into the 4-wire here you will have extra 4-wire to use in the ceiling fan box.
Don't disconnect the red wire going to the duplex receptacle.
Just tie red and black to the un-switched black in your junction box. This puts half the load on each wire and you don't have to rewire the receptacle in the wall.
Get a deep 2-gang switch box to fit all those connectors
and dissipate the heat any dimmers you use to control fan speed or dim the fan lights. You're looking at needing at more than 29 cubic inches not counting extra for dimmers. And you always want to leave room for future expansion.
Get a ceiling box designed to hold a fan and mount it securely to a joist.
So tying into and out of the ceiling box for the fan would require 12" of slack on the existing 4-wire cable. Your plan to add a separate junction box is a better approach. The trick is to put it at least 6" closer to the dual-wired receptacle and run 3-wire the longer distance to this box. When you tie into the 4-wire here you will have extra 4-wire to use in the ceiling fan box.
- Don't disconnect the red wire going to the duplex receptacle.
Just tie red and black to the un-switched black in your junction box. This puts half the load on each wire and you don't have to rewire the receptacle in the wall.
- Get a deep 2-gang switch box to fit all those connectors
and dissipate the heat any dimmers you use to control fan speed or dim the fan lights. You're looking at needing at more than 29 cubic inches not counting extra for dimmers. And you always want to leave room for future expansion.
- Get a ceiling box designed to hold a fan and mount it securely to a joist.