If you only need about one to two minute to perform your operation, you can use a common household object to achieve the same effect.

Simply put the guinea pig into a plastic bag, and use an airduster (aka canned air or compressed air) to pump gas into the plastic bag. Keep the exhaust away from the guinea pig as it will freeze burn the skin. You only need to press 2~3 times. Since the gas is denser than air, guinea pig will be paralyzed after inhaling the gas for about 15 seconds. You can remove the guinea pig from the bag after it loses its conscious for about 10 seconds. The guinea pig should still be breathing but unconscious (like in a coma). Depending on the size of the guinea pig / amount of gas it inhaled / ventilation of the area, you will have 1 to 2 minutes to perform the operation you want to perform without the guinea pig struggling.
If you want to put the guinea pig to sleep forever, just keep pumping the gas without removing the guinea pig form the plastic bag. The guinea pig will remain unconscious and eventually die after 5 minutes.