centering a sprite in the middle of the screen convertToWorldSpace / NodeSpace

i have passed many many days on this problem, i've not very clear in mind what convertToWorldSpace, convertToNodeSpace does...

i have 2 layer (CCNode) one that i can scale, one for panning the screen, so i scale always what is displayed makeing the center of scaling the middle of the screen:
scaleLayer=[CCNode node];
scaleLayer.position= ccp( size.width /2 , size.height/2 );
[self addChild:scaleLayer z:-2000];

i'd like to have a button that, when pressed, moves panlayer to make the sprite in the middle of the screen.
i have wrote this but works only if scaleLayer.scale=1
CGPoint p;
p=[panLayer convertToWorldSpace:mysprite.position];
p.x=(panLayer.position.x+(240-p.x));
p.y=(panLayer.position.y+(160-p.y));
[panLayer runAction:[CCMoveTo actionWithDuration:0.5 position]];

how can i make the sprite to be at center of the screen with different scales?
i thought to find the distance in pixels in scaleLayer coordinates while convertToWorldSpace find the absolute coordinates (if i had understood well)
thanks