If you have attempted to file your federal return prior to April 15 and it was sent back for correction, you have until April 20 to have it corrected and still be considered on time.
If you are due a refund, there is not a deadline or penalty imposed. The due date is primarily for paying tax due. You can submit your online return thru October 15 without filing an extension when you are due a refund. You have three years to claim your refund thru the mail after that.
If you owe the IRS taxes, you can still submit your online return until October 15, but if you did not send the money to the IRS by April 15 you may have penalties and/or interest assessed. An extension allows more time to file without penalties, not more time to pay.
The software does not figure penalties and interest for you. The IRS will send you a bill or you can calculate the amount and add it to the amount you owe. The extension deadline is April 15.
As for the state return, each state has different rules and you need to confirm with your particular state but federal extensions are accepted by several states.