So I have an account that I bot, I know it'll get banned eventually.
Now if I want to create another account can I add the code to the same Battle net account?
Yes, you would create another Wow license on the b.net account.
Keep in mind, we are capped to have only 8 Wow licenses per region in the same battle.net account
For reference - see how looks nowadays a "common" botting-for-profit battle.net account:
With a soup of bans, suspensions, active, frozen and starter licenses
Can I log on both accounts at once?
Ingame, you log independently per WoW license.
Also if my botting accounts gets banned will my main?
Generally no.
Nearly 99.5% of the bans for botting are actioned on the violating licenses only
The last 0.5% of the cases remain for those scenarios, where different activity than botting take place.
Like goldselling, goldbuying, simultaneous using of tons of bots on your computer (5-10-15), using h4cking software (hello Tyrants) or ingame exploits or bugs, like duping, wintrading, purchase RBG/Arena Boosting, etc- Basicly anything, which is against Blizzard TOU/EULA.
All of these are in the 0.5% pool just because, generally you must be reported, so a manual investigation is performed by Game Master should have the passion to dig deeply in your account's logs to action you in such harsh manner.
These bans are usually hidden behind the label: Banned for "Abuse of Economy" or for "Extreme Exploitation"