Len, mikebr99 did say remain hidden the whole time, so to remain hidden while making the ranged attack you would have a -20 penalty to the hide check. From there on he and I differ in opinion
Just because I have to put in the opposing view here . . .
The Hide ability says you can hide while attacking but does not limit that to the Attack Standard Action
If your character wants to remain hidden for the entire round, even during the attack, and your character has the HiPS ability, your round would look like
Make a Full Attack as a Full Round Action
Make a Hide Check with a -20 penalty (I would actually require a Hide Check after every attack in a full round attack, but that's just me)
Take a 5' step before or after your Attack(s) if you choose
OR
Make a Single Attack as a Standard Action
Make a Hide Check with a -20 penalty
Use a Move Action
mikebr99 and I disagree on this issue and will probably never agree

- use whatever fits your campaign best - both interpretations are supported by the RAW.