Welcome to the Community!
You can create custom chart of accounts to allocate these prior transactions for VAT. For example, to record the VAT bill for Q4 2108, you can enter this as an expense and allocate it to an expense chart of account. To create the chart of account, go to Accounting > New and select 'expenses' as the account type and 'taxes paid' as the detail type.
For the cheque for the Q3 2018 VAT return, you can record this on a bank deposit and create an income account for this, such as 'VAT refund'.