Miniaturized mass spectrometers, with their increasing portability and performance enhancements, play a crucial role in selectively analyzing target compounds within complex mixtures, particularly in situ environments. As part of our ongoing efforts to enhance the analytical capabilities of the custom-built "brick" mass spectrometer, this study compared and optimized methods for ion isolation using Stored Waveform Inverse Fourier Transform (SWIFT) and Grid-SWIFT waveforms. The efficacy of the SWIFT and Grid-SWIFT waveforms in selective ion isolation was investigated, and through optimization of both waveforms, improved ion isolation efficiency, and peak resolution were demonstrated by adjusting waveform duration and amplitude. The results conclusively showed that Grid-SWIFT outperforms traditional SWIFT waveforms in enhancing the isolation of target ions. Additionally, a novel simulation-based approach was developed to simulate the behavior of ion trajectories under the SWIFT and Grid-SWIFT waveforms within LIT to provide a theoretical basis for better performance of the Grid-SWIFT waveforms. Results show that longer waveform durations help reduce energy leakage, providing higher isolation efficiency. Grid-SWIFT waveforms exhibited significantly less energy leakage compared to SWIFT waveforms. Consequently, using Grid-SWIFT as isolation waveforms improved the mass spectra' intensity and resolution.