Yes, you can purchase an HDB flat. As a 30-year-old Singaporean married to a foreigner, you fall under the "Non-resident spouse" category. Your non-resident spouse must have a valid Long Term Visit Pass or Work Pass of at least 6 months from the date of issue at the point of your HFE letter and resale flat application.