How does iWork for iOS know what account to use for icloud?
You can use different accounts for iCloud and the App store by logging in in Settings. For document storage the iCloud account is used.

Keeping iWork apps on an iPad you sell is probably violating the license agreement. And there will be no way to update the applications later because this would require the original iOS App Store password.