How to plumb and line, i.e., square, stud-frame walls if sheathing before raising
Your plan is correct. I usually tack the bottom plate to the wall line on the deck at several points to be sure it's straight. If you do this correctly you can easily pull the nails once the wall is up and nailed down. Don't do it from the bottom of the plate as the nails will hold the wall off the deck. 

Now you pull diagonal measurements from the bottom plate corners to the top plate corners (not the double/tie plates as they don't match). Tack the top plate to the deck in one spot and you're golden. Sheathed walls are extremely rigid with respect to square. Don't expect to be able to make adjustments. They'll even show you where your deck has dips. 

I'm not sure what you mean by "lining" but if it means straightening the top, I usually tack a scrap of two-by at each end, run a dryline between, and measure for 1-1/2". You'd have your ends plumbed and braced (or tied into perpendicular walls which are already square) first.