Your sentences may well be correct, but it's a little hard to be certain. If someone acts 'accordingly', the action is appropriate to what has gone before or the situation they are in. We don't know the circumstances of the action in your sentences, but on the face of it, you are using the word correctly.
Respectively has a different meaning altogether, and is used to indicate order:
In the test cricket, Smith and Warner scored 69 and 98 runs respectively.