There is a dispute as to whether nightfall begins at sunset or at Tzet Hakochavim, and Ben Hashemashot represents the time in between the two, and is considered to be a Halachically ambiguous time. Accordingly, during Ben Hashemashot of Shabbat it is unclear whether or not Shabbat has commenced. Due to this ambiguity, the Shulhan Aruch (O.H. 307:22) rules that one may perform Rabbinically-forbidden act in the time of Ben Hashemashot of Shabbat for the sake of a Mitzvah, such as asking a non-Jew to do a Melacha on one’s behalf.
Regarding how long Ben Hashemashot lasts, there are a multitude of opinions, given different geographic locations and given when Tzet Hakochavim is. As such, Rabbi Moshe Feinstein (Igrot Moshe, vol. IV, Orah Haim, § 62) writes that with respect to this Halacha, one may rely on Ben Hashemashot lasting up until the time of Tzet Hakochavim of Rabbenu Tam, which is the latest opinion. Nonetheless, Rabbi Ovadia Yosef (Hazon Ovadia, vol. III, pg. 488) questions this approach and writes that it is questionable if one can rely on such a late time as Rabbenu Tam. It is plausible that Rabbi Moshe Feinstein’s opinion can be relied upon in extenuating situations in which one would ask a non-Jew to perform some act in an unusual manner (“Shinui”). That said, one should be strict and consider Ben Hashemashot as being the time between sunset and Tzet Hakochavim according to the Geonim. These times are readily available online and in Jewish calendars.
Summary: One may ask a non-Jew to perform a Melacha on one’s behalf for the sake of Mitzvah during Ben Hashemashot of the beginning of Shabbat.