R Eliezer Melamed (here) writes
In practice, all Sephardim and Ashkenazim should recite “HaGomel” only
after an illness that is in danger of justifying desecration of the
Sabbath in order to heal the patient.
which would mean your non-urgent situations wouldn't justify saying the blessing.
Nishmat Avraham (vol 1, on OC 219:8) writes that any serious illness where one is in bed for 3 days or life threatening illness both justify the blessing. Your cases wouldn't qualify either.
The Tzitz Eliezer (12:18) writes that somebody who undergoes an operation (under general anaesthesia) should say birkat hagomel. To the question of what anaesthesia qualifies as such, R Binyamin Tabady told me it has to be an operation where a specialist monitors the breathing (as opposed to local anaesthesia typically administered by the doctor). Colonoscopy can be done using both local anaesthesia or deep sedation (see e.g., here) so the answer to your question might depend on the specifics of the operation.
R Aharon Lichtenstein in a longer review of sources (part 1, part 2) writes something even more specific to your question
And the Magen Avraham writes that some are accustomed to act in
accordance with the position of the Shulchan Arukh, and so is the
opinion of the Elya Rabba. And so writes the Magen Gibborim that
whoever was sick throughout his body such that Shabbat could be
desecrated on his behalf by way of a non-Jew, recites the Ha-Gomel
blessing [he brings this also in the name of the Radbaz]. In similar
manner writes the Chayyei Adam. He, however, writes that in any event
a person should only recite the blessing if he was bedridden for at
least three days. See Be'ur Halakha, that if his illness involves a
danger, then even if he was bedridden for less than three days, he
must recite the blessing.
The Mishna Berura recognizes the fact that some have not accepted the
ruling of the Rema, but he sets two conditions: First, the illness
must have lasted for at least three days, and second, the illness must
have involved a certain degree of danger.
Beginning of part 2, he brings up the case of someone who had a tumor and a biopsy shows it was benign and analyses whether one could say the birkat hagomel without Hashem's name. He concludes this is indeed the correct way to give expression to a person's feeling of gratitude toward his Creator for having avoided a major health scare.
Of course, consult your rabbi
before implementing anything you learn here.