If you use a different mass of magensium metal in an experiment would the empirical formula of the compund be the same?

If the experiment is conducted properly, yes. More Mg just requires more oxygen to combine with it but th ratio stays the same.