Hide/un-hide directory and open directory based on argument
Avoid echo -n

Avoid using any flags of echo, like this, as it's not portable:


    echo -n ": "



This is more portable, and produces the same output:

    printf ": "


Get rid of empty statements

These empty else statements are pointless,
I suggest to remove them:


else
    :



Simplify

This can be simplified:


    if [ "$result" = "$input" ]
    then
        clear
        mv $DIR2 $DIR
    else
        clear
    fi



Since in both branches of the if-else you clear, this is the same:

    clear
    if [ "$result" = "$input" ]
    then
        mv $DIR2 $DIR
    fi


Quote variables in paths

Typically you should double-quote variables,
especially when used as paths. So instead of this:


        mv $DIR2 $DIR



This is recommended and safer:

        mv "$DIR2" "$DIR"


Avoid duplicated code

The code in opendir and basic is almost the same.
The only difference I see is the content of the "$result" = "$input" conditions.
Consider using a single function with a flag to determine the behavior inside the main conditional.