There's no code required to sign all agents in the database with the current ID. It can be done simply and easily through the Domino Administrator client.
Using the ID that you want to use as the signer, open up Domino Administrator. Take the following steps: Go to File/Open Server and select the server the database resides on. Go to the Files tab. Select the database with the agents to be signed. Go to Database Tools and select Sign. Set All Documents of Type to Agent.
Press the OK button.
It then signs your agents with the current ID. (You also have the option to sign instead with the server ID if desired).