That hack will break any other form submission or postback of other features on the same page because it closes the main form prematurely and it is invalid markup because there still remains the real closing tag of the main form.
A better way is to implement a custom feature and set the PostBackUrl property on the button as described in the article Building a Simple PayPal Buy Now feature.
Hope that helps,
Joe