BIP38 encryption (which relies on scryptsy) should really be asynchronous. Otherwise the browser blocks and the user does not receive progress updates until after a key is fully encrypted.
I've implemented asynchronous support for bip38 and scryptsy here and here for consideration.