I'm not sure I'm following you a 100% here. You say you have a split stay with the 40% off. Are both stays booked with the pin or just part of one due to uncovered dates for the first part of the trip? You also say you plan on upgrading when you get there. Does that mean you already have a ticket? Or are you booked with a package and have 40% off the room only portion? How I specifically answer can vary depending on your answers to these questions.
Generally, you don't need to have an AP to book, only at check-in. So, you can take your ticket, use it once if your tickets were purchased at a discount to get full gate value, upgrade it at guest services, and then use it for the AP code. Sometimes (and this does vary because it isn't official Disney policy) you can check in without it and tell them you'll be getting the AP. They'll often let you keep the rate if you come back within 24 hours and show an activated AP. If not, they'll charge you rack rate.
You just have to call to book the rate rather than having the opportunity to book online.
Now, something I should note... If you have left over days on tickets, they are probably not upgradeable. Tickets can only be upgraded within 14 days of first use. So, if left over from a previous trip, then you may not upgrade them. Unless, of course, they are unused tickets. Then no problem. Also, use any tickets purchased from a discount broker or before the last price increase before doing the upgrade. If not, you only get credit for the amount Disney sold the ticket for--which if you got the ticket from a discount broker, it could very well be less than what you paid for them. By using the ticket first, it is bridged (or should be, watch the CM to make sure they do it) to the price of current gate value and that amount is credited towards the purchase of your AP. If you don't have any tickets yet, you *may* just want to go ahead and purchase AP vouchers.