An Indirect Pulp Cap is a procedure that is used when the dentist gets close to the nerve when removing decay. This is a perfectly proper dental procedure, and is used in cases where the nerve (or pulp) would be exposed if all the decay were removed from the cavity. Regarded as a conservative treatment, the application of medicated cement in the temporary filling helps the pulp of the tooth to repair itself by containing the decay and allowing the buildup of a wall of tooth structure between the pulp and the decayed material.
This is a “holding action”. When your dentist removes the temporary filling, he may take an xray to determine if the pulp has healed. If so, the balance of the decay is removed, and a permanent restoration, or filling, can be placed in the tooth.
In summary, your dentist is trying to keep your tooth alive, avoiding the need for a root-canal filling, pulp capping, or extraction of the tooth.