You are correct! The magnesium cation is isoelectronic with neon, an inert gas and is more stable because of this electron configuration.