I just used a mythril halberd and hoped fro the best.
For the ideal use of a melee weapon again a wyvern you would need a wooden platform a certain distance above another platform or regular blocks. You would let the wyvern come at you and then drop down and strike its underside.
EDIT: This method would be more efficient than a demon scythe, however, it would be time consuming to get the distance correct and the low gravity of space may make timing the drop difficult.